Skip to content

fix(responses): forward allowed_openai_params through the chat completions bridge - #35885

Merged
yucheng-berri merged 1 commit into
litellm_internal_stagingfrom
devin_ai_fix_responses_bridge_allowed_openai_params_35878
Aug 8, 2026
Merged

fix(responses): forward allowed_openai_params through the chat completions bridge#35885
yucheng-berri merged 1 commit into
litellm_internal_stagingfrom
devin_ai_fix_responses_bridge_allowed_openai_params_35878

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • allowed_openai_params is ignored on the responses to chat completions bridge
  • bridged calls raise UnsupportedParamsError for params the caller allowed

How it solves it:

  • pass allowed_openai_params explicitly into response_api_handler
  • it then reaches litellm.completion / acompletion through kwargs

Relevant issues

Fixes #35878

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Screenshots / Proof of Fix

allowed_openai_params is a named parameter of responses(), so it never sits in kwargs. The bridge branch forwarded only **kwargs to litellm_completion_transformation_handler.response_api_handler, which builds its completion_args from those kwargs, so the allowlist was lost and litellm.acompletion rejected the very param the config allowed

Config used for both runs (real Anthropic API through its OpenAI compatible endpoint, so the model has no reasoning_effort support and the allowlist is what makes the call legal):

model_list:
  - model_name: bridged-model
    litellm_params:
      model: openai/claude-haiku-4-5-20251001
      api_base: https://api.anthropic.com/v1
      api_key: os.environ/ANTHROPIC_API_KEY
      use_chat_completions_api: true
      allowed_openai_params: ["reasoning_effort"]
general_settings:
  master_key: sk-1234

Before, at b35947b358 with the one line fix reverted:

curl -s http://localhost:4000/v1/responses -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" \
  -d '{"model":"bridged-model","input":"say hi in 3 words","reasoning":{"effort":"low"},"tools":[{"type":"function","name":"noop","parameters":{"type":"object","properties":{}}}]}'
{"error":{"message":"litellm.UnsupportedParamsError: openai does not support parameters: ['reasoning_effort'], for model=claude-haiku-4-5-20251001. To drop these, set `litellm.drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params: true`\n. \n If you want to use these params dynamically send allowed_openai_params=['reasoning_effort'] in your request.. Received Model Group=bridged-model\nAvailable Model Group Fallbacks=None","type":"None","param":null,"code":"400"}}

After, same curl at b35947b358:

{"id":"resp_Gsvjwo82g3ixQdfVgF5NAqwy_dl31wBon-LCVp51X4tDfn3qu57AKq5fD1IrU6xs12Y83R8RaLRRbGKhaYgqYk76rYK...","created_at":1785895708,"model":"bridged-model","object":"response","output":[{"type":"message","id":"msg_011Cdina61cvYZqiZ3z1ytH9","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi, how are you?","annotations":[]}]}],"parallel_tool_calls":false,"temperature":0.0,"tool_choice":"auto"}

The new regression test fails on the unfixed tree and passes with the fix, and the rest of tests/test_litellm/responses/ stays green (415 passed)

Type

🐛 Bug Fix

Changes

litellm/responses/main.py now passes allowed_openai_params=allowed_openai_params alongside **kwargs when it hands off to the chat completions bridge. The handler already spreads its kwargs into the completion / acompletion call, and completion reads the allowlist out of kwargs, so nothing else needs to change. The native responses path already forwarded it, and so did the emulated file_search path, which is why this only ever bit the bridge

tests/test_litellm/responses/test_responses_api_bridge_flag.py gains a test that drives aresponses with use_chat_completions_api=True plus allowed_openai_params=["reasoning_effort"] and asserts the allowlist arrives at litellm.acompletion

Issue #35878 also reports that namespace and tool_search tools are dropped by the bridge. That part is deliberately left out of this PR: tool_search is in fact forwarded verbatim today, and namespace is dropped on purpose by #32258 because most chat completions providers reject it, even though the Anthropic chat transformation does know how to flatten it. Deciding between dropping and flattening per provider is a design call for the owner of that transformation

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Note

Low Risk
Single-parameter forwarding on an existing code path with a targeted regression test; no auth, security, or broad API behavior changes beyond fixing the bridge allowlist.

Overview
Fixes bridged /v1/responses calls (e.g. use_chat_completions_api or providers without native Responses support) incorrectly raising UnsupportedParamsError when callers pass allowed_openai_params to permit params like reasoning_effort.

Because allowed_openai_params is a named argument on responses(), it was not included in **kwargs passed to litellm_completion_transformation_handler.response_api_handler, so the allowlist never reached litellm.completion / acompletion. The change explicitly passes allowed_openai_params=allowed_openai_params on that bridge handoff (native Responses and emulated file_search paths already forwarded it).

Adds a regression test on aresponses with the bridge enabled that asserts allowed_openai_params is present on the mocked acompletion call.

Reviewed by Cursor Bugbot for commit 11c3bd3. Bugbot is set up for automated code reviews on this repo. Configure here.

…tions bridge

Resolves #35878

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR fixes the Responses-to-chat-completions bridge by forwarding the caller’s allowed_openai_params value to the existing completion handler.

  • Passes allowed_openai_params through the bridge to completion and acompletion.
  • Adds an asynchronous regression test confirming that the allowlist reaches litellm.acompletion.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The newly forwarded argument is accepted through the handler’s keyword collection and preserved when constructing both synchronous and asynchronous completion arguments, while the regression test verifies the affected asynchronous path.

Important Files Changed

Filename Overview
litellm/responses/main.py Explicitly forwards the named allowlist parameter through the chat-completions bridge without changing native Responses behavior.
tests/test_litellm/responses/test_responses_api_bridge_flag.py Adds a focused mocked regression test that exercises the asynchronous bridge and verifies the allowlist reaches acompletion.

Reviews (1): Last reviewed commit: "fix(responses): forward allowed_openai_p..." | Re-trigger Greptile

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing devin_ai_fix_responses_bridge_allowed_openai_params_35878 (11c3bd3) with main (cfe8552)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (fa2d97f) during the generation of this report, so main (cfe8552) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@yucheng-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 11c3bd3. Configure here.

@yucheng-berri
yucheng-berri merged commit f05d468 into litellm_internal_staging Aug 8, 2026
79 checks passed
@yucheng-berri
yucheng-berri deleted the devin_ai_fix_responses_bridge_allowed_openai_params_35878 branch August 8, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] use_chat_completions_api bridge: allowed_openai_params not forwarded + namespace/tool_search tools dropped

2 participants