fix(responses): pass api_base to the responses bridge check

The bridge probe called responses_api_bridge_check without api_base, so it
resolved the OpenAI base from globals and environment rather than from the
request, while litellm.completion runs the same check with the caller's value.

Today the two cannot disagree: this path always supplies a reasoning_effort,
which short-circuits the endpoint term in the only arm that reads it. Passing it
anyway keeps the probe a faithful mirror of the definitive check rather than one
that happens to agree.
This commit is contained in:
Joshua Garnett 2026-08-09 13:58:23 -04:00 • committed by ryan-crabbe-berri
parent 1d5ed79931
commit 3d648b7fe1

View file

@ -316,6 +316,7 @@ class LiteLLMCompletionResponsesConfig:
tools: Sequence[ChatCompletionToolParam | OpenAIMcpServerTool] | None,
web_search_options: OpenAIWebSearchOptions | None,
reasoning_param: Reasoning,
api_base: str | None,
) -> bool:
"""
Whether ``litellm.completion`` will route this model back onto the Responses API.
@ -333,6 +334,7 @@ class LiteLLMCompletionResponsesConfig:
tools=tools,
reasoning_effort=reasoning_param,
reasoning_summary=reasoning_param.get("summary"),
api_base=api_base,
)
except Exception as e: # noqa: BLE001 # a capability probe must never fail the request it probes for
verbose_logger.debug(f"responses bridge: reasoning effort mode check failed: {e}")
@ -346,6 +348,7 @@ class LiteLLMCompletionResponsesConfig:
custom_llm_provider: str | None,
tools: Sequence[ChatCompletionToolParam | OpenAIMcpServerTool] | None = None,
web_search_options: OpenAIWebSearchOptions | None = None,
api_base: str | None = None,
) -> Reasoning | str | None:
"""
Map the Responses ``reasoning`` param onto Chat Completions ``reasoning_effort``.
@ -366,6 +369,7 @@ class LiteLLMCompletionResponsesConfig:
tools=tools,
web_search_options=web_search_options,
reasoning_param=reasoning_param,
api_base=api_base,
):
return reasoning_param
return reasoning_param.get("effort")
@ -407,6 +411,7 @@ class LiteLLMCompletionResponsesConfig:
custom_llm_provider=custom_llm_provider,
tools=tools,
web_search_options=web_search_options,
api_base=kwargs.get("api_base"),
)
)