From f985141e7cdfda45188124a7cc8cc1932d215d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onat=20=C3=96zmen?= Date: Sun, 30 Aug 2026 17:26:11 +0300 Subject: [PATCH] test(responses): cover effort drop temperature interaction --- .../test_reasoning_effort_capability.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_litellm/llms/openai/responses/test_reasoning_effort_capability.py b/tests/test_litellm/llms/openai/responses/test_reasoning_effort_capability.py index e055f413faf..2eef324eacd 100644 --- a/tests/test_litellm/llms/openai/responses/test_reasoning_effort_capability.py +++ b/tests/test_litellm/llms/openai/responses/test_reasoning_effort_capability.py @@ -1,6 +1,7 @@ import pytest import litellm +from litellm.llms.openai.chat.gpt_5_transformation import OpenAIGPT5Config from litellm.llms.openai.responses.transformation import OpenAIResponsesAPIConfig @@ -38,3 +39,20 @@ def test_drop_params_removes_only_unsupported_effort() -> None: ) assert result["reasoning"] == {"summary": "detailed"} + + +def test_drop_params_revalidates_temperature_after_effort_drop(monkeypatch: pytest.MonkeyPatch) -> None: + config = OpenAIResponsesAPIConfig() + + monkeypatch.setattr(OpenAIGPT5Config, "_supports_reasoning_effort_level", lambda model, level: False) + monkeypatch.setattr(config, "_supports_reasoning_effort_none", lambda model: True) + monkeypatch.setattr(config, "_effort_resolves_to_none", lambda model, effort: effort is None) + + result = config.map_openai_params( + response_api_optional_params={"reasoning": {"effort": "xhigh"}, "temperature": 0.5}, + model="gpt-5-test", + drop_params=True, + ) + + assert "reasoning" not in result + assert result["temperature"] == 0.5