From b1508161ecb5bd2695fb677101cca8755d489bcd Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 11 May 2026 15:25:40 +0000 Subject: [PATCH] Preserve reasoning summary without effort --- litellm/main.py | 2 ++ tests/test_litellm/test_main.py | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/litellm/main.py b/litellm/main.py index c324f982b8..29a9ffc84f 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -1684,6 +1684,8 @@ def completion( # type: ignore # noqa: PLR0915 "effort": eff, "summary": rs_val, } + else: + optional_params["reasoning_effort"] = {"summary": rs_val} return responses_api_bridge.completion( model=model, diff --git a/tests/test_litellm/test_main.py b/tests/test_litellm/test_main.py index c37f9fc26b..76336a91fc 100644 --- a/tests/test_litellm/test_main.py +++ b/tests/test_litellm/test_main.py @@ -875,6 +875,30 @@ def test_gpt_5_4_responses_bridge_merges_reasoning_summary_kwarg_without_tools( assert "reasoning_summary" not in optional_params +@patch("litellm.completion_extras.responses_api_bridge.completion") +def test_responses_bridge_preserves_reasoning_summary_without_effort( + mock_responses_completion, +): + """Reasoning summary should survive responses routing even without effort.""" + mock_responses_completion.return_value = MagicMock() + + import litellm + + with patch.object(litellm, "route_all_chat_openai_to_responses", True): + litellm.completion( + model="gpt-4o", + messages=[{"role": "user", "content": "ok"}], + reasoningSummary="auto", + api_key="fake-key", + ) + + assert mock_responses_completion.called is True + optional_params = mock_responses_completion.call_args.kwargs["optional_params"] + assert optional_params["reasoning_effort"] == {"summary": "auto"} + assert "reasoningSummary" not in optional_params + assert "reasoning_summary" not in optional_params + + @patch("litellm.completion_extras.responses_api_bridge.completion") def test_gpt_5_responses_bridge_tools_and_reasoning_summary( mock_responses_completion,