You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Azure GPT-5 fails due to hardcoded temperature in responses_options.py #986
╭───────────────────────────────────────────── Message to User ─────────────────────────────────────────────╮
│ │
│ Write 3 facts about the current project into FACTS.txt. │
│ │
╰───────────────────────── Tokens: ↑ input 0 • cache hit N/A • ↓ output 0 • $ 0.00 ─────────────────────────╯
Traceback (most recent call last):
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/openhands-sdk/openhands/sdk/conversation/impl/local_conversation.py", line 269, in run
self.agent.step(self, on_event=self._on_event)
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/openhands-sdk/openhands/sdk/agent/agent.py", line 186, in step
raise e
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/openhands-sdk/openhands/sdk/agent/agent.py", line 145, in step
llm_response = self.llm.responses(
^^^^^^^^^^^^^^^^^^^
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/openhands-sdk/openhands/sdk/llm/llm.py", line 615, in responses
resp: ResponsesAPIResponse = _one_attempt()
^^^^^^^^^^^^^^
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 338, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 477, in __call__
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 378, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 400, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/Users/zhengmingzhang/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/Users/zhengmingzhang/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 480, in __call__
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/openhands-sdk/openhands/sdk/llm/llm.py", line 591, in _one_attempt
ret = litellm_responses(
^^^^^^^^^^^^^^^^^^
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/litellm/utils.py", line 1365, in wrapper
raise e
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/litellm/utils.py", line 1238, in wrapper
result = original_function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/litellm/responses/main.py", line 665, in responses
raise litellm.exception_type(
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/litellm/responses/main.py", line 615, in responses
ResponsesAPIRequestUtils.get_optional_params_responses_api(
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/litellm/responses/utils.py", line 85, in get_optional_params_responses_api
ResponsesAPIRequestUtils._check_valid_arg(
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/litellm/responses/utils.py", line 52, in _check_valid_arg
raise litellm.UnsupportedParamsError(
litellm.exceptions.UnsupportedParamsError: litellm.UnsupportedParamsError: LlmProviders.AZURE does not support parameters: {'temperature': 1.0}, for model=gpt-5. To drop these, set `litellm.drop_params=True` or for proxy:
`litellm_settings:
drop_params: true`
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/examples/01_standalone_sdk/01_hello_world.py", line 26, in <module>
conversation.run()
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/openhands-sdk/openhands/sdk/conversation/impl/local_conversation.py", line 288, in run
raise ConversationRunError(self._state.id, e) from e
openhands.sdk.conversation.exceptions.ConversationRunError: Conversation run failed for id=5d7f241e-9ed0-47a2-8fb4-2ad6f04c9fc6: litellm.UnsupportedParamsError: LlmProviders.AZURE does not support parameters: {'temperature': 1.0}, for model=gpt-5. To drop these, set `litellm.drop_params=True` or for proxy:
`litellm_settings:
drop_params: true`
/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/async_client_cleanup.py:66: DeprecationWarning: There is no current event loop
loop = asyncio.get_event_loop()
The fix ensures that Azure GPT-5 and other reasoning models (o1, o3) no longer fail with UnsupportedParamsError when using the Responses API, while preserving the existing behavior for non-reasoning models.
Yes, I think so. 🤔 My recollection is that there was a model which ONLY accepted temperature = 1, I believe that’s why we hardcoded it. I have the agent try a few, to see if we get one to fail the PR. 🤔
Can you try new api version to api-version=preview to check if that works
Same Problem😥 @enyst@xingyaoww
I’m not sure if LiteLLM has compatibility issues with Azure support.
By the way, Claude on Amazon (via boto3) works well.
importosfrompydanticimportSecretStrfromopenhands.sdkimportLLM, Conversationfromopenhands.tools.preset.defaultimportget_default_agent# Configure LLM and agent for Azure OpenAI GPT-5model="azure/gpt-5"llm=LLM(
model=model,
api_key=SecretStr("xxxxxxx"),
base_url="https://xxxxx.azure.com",
api_version="preview",
usage_id="agent",
)
agent=get_default_agent(llm=llm, cli_mode=True)
litellm.exceptions.UnsupportedParamsError: litellm.UnsupportedParamsError: LlmProviders.AZURE does not support parameters: {'temperature': 1.0}, for model=gpt-5. To drop these, set `litellm.drop_params=True` or for proxy:
`litellm_settings:
drop_params: true`
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/examples/01_standalone_sdk/01_hello_world.py", line 26, in <module>
conversation.run()
File "/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/openhands-sdk/openhands/sdk/conversation/impl/local_conversation.py", line 288, in run
raise ConversationRunError(self._state.id, e) from e
openhands.sdk.conversation.exceptions.ConversationRunError: Conversation run failed for id=4a6bb668-0ef2-46b3-adcf-ddbd975a5411: litellm.UnsupportedParamsError: LlmProviders.AZURE does not support parameters: {'temperature': 1.0}, for model=gpt-5. To drop these, set `litellm.drop_params=True` or for proxy:
`litellm_settings:
drop_params: true`
/Users/zhengmingzhang/PycharmProjects/software-agent-sdk/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/async_client_cleanup.py:66: DeprecationWarning: There is no current event loop
loop = asyncio.get_event_loop()
(software-agent-sdk) ➜ software-agent-sdk git:(main) ✗
This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.
Activity
Shimada666 commentedon Nov 1, 2025
responses(options): skip temperature for reasoning models (e.g., GPT-…
xingyaoww commentedon Nov 2, 2025
@OpenHands please fix this issue by stop hard code temperature for reasoning models
openhands-ai commentedon Nov 2, 2025
Uh oh! There was an unexpected error starting the job :(
xingyaoww commentedon Nov 2, 2025
@OpenHands please fix this issue by stop hard code temperature for reasoning models
openhands-ai commentedon Nov 2, 2025
I'm on it! xingyaoww can track my progress at all-hands.dev
Fix: Skip temperature parameter for reasoning models in Responses API
openhands-ai commentedon Nov 2, 2025
✅ Successfully Fixed Issue #986
I've successfully resolved the hardcoded temperature issue for reasoning models in the Responses API. Here's what was accomplished:
Changes Made
1. Fixed
responses_options.py(openhands-sdk/openhands/sdk/llm/options/responses_options.py)get_featuresfrommodel_featuresselect_responses_options()to conditionally handle temperature:chat_options.py2. Updated Tests (
tests/sdk/llm/test_responses_parsing_and_kwargs.py)Verification
✅ All 337 tests in
tests/sdk/llm/pass✅ Pre-commit hooks pass (ruff, pyright, pycodestyle)
✅ Changes are minimal and focused on the issue
Pull Request Created
PR #992: #992
openhands/fix-reasoning-model-temperatureThe fix ensures that Azure GPT-5 and other reasoning models (o1, o3) no longer fail with
UnsupportedParamsErrorwhen using the Responses API, while preserving the existing behavior for non-reasoning models.View full conversation
xingyaoww commentedon Nov 2, 2025
I think openai's responses API does support temperature: https://platform.openai.com/docs/api-reference/responses/create#responses_create-temperature
Also it seems azure does support it too: https://learn.microsoft.com/en-us/azure/ai-foundry/openai/reference-preview-latest#request-body-14
Can you try new api version to
api-version=previewto check if that worksenyst commentedon Nov 2, 2025
Yes, I think so. 🤔 My recollection is that there was a model which ONLY accepted temperature = 1, I believe that’s why we hardcoded it. I have the agent try a few, to see if we get one to fail the PR. 🤔
enyst commentedon Nov 2, 2025
The agent posted its tests in the PR, from here:
#992 (comment)
=> With and without proxy, for 4 OpenAI models, it looks like
temperature=1or no temperature specified work, while other values in range 0..2 nope. 😅I think there was somewhere in OpenAI docs that only "1" works, but I can't find it for the life of me. 😂
1 is also the default.
I'd love to know the result of this.
Shimada666 commentedon Nov 3, 2025
Same Problem😥 @enyst @xingyaoww
I’m not sure if LiteLLM has compatibility issues with Azure support.
By the way, Claude on Amazon (via boto3) works well.
xingyaoww commentedon Nov 3, 2025
I had OpenHands look into the litellm repo, and it seems the root issue comes from litellm. Will be fixed here:
BerriAI/litellm#16206
all-hands-bot commentedon Dec 29, 2025
This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.