Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Preserve reasoning summary without effort

Cursor Agentb1508161ecb5
diff --git a/litellm/main.py b/litellm/main.py
index c324f982b84..29a9ffc84f8 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 c37f9fc26b4..76336a91fc3 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,