Repository navigation
feat(proxy): auto-enable drop_params for Codex user agents - #34068
Merged
mateo-berri merged 1 commit intoJul 21, 2026
Merged
Conversation
Merged
3 of 5 tasks
Contributor
Greptile SummaryThis PR extends automatic parameter dropping to Codex clients. The main changes are:
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| litellm/proxy/litellm_pre_call_utils.py | Adds Codex user-agent detection and extends the existing automatic drop_params behavior without changing explicit-setting precedence |
| tests/test_litellm/proxy/test_litellm_pre_call_utils.py | Adds Codex user-agent and precedence cases while retaining the existing Claude Code and unrelated-client coverage |
Reviews (1): Last reviewed commit: "feat(proxy): auto-enable drop_params for..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
tin-berri
approved these changes
Jul 21, 2026
Contributor
Merging this PR will improve performance by 30.97%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_completion_streaming |
58.8 ms | 34.6 ms | +69.66% |
| ⚡ | test_response_to_model_response_object |
543.5 µs | 411.8 µs | +31.99% |
| ⚡ | test_cost_per_token_openai |
597.7 µs | 520 µs | +14.95% |
| ⚡ | test_cost_per_token_anthropic |
602.6 µs | 527.2 µs | +14.29% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing litellm_codex_auto_drop_params (d2b573c) with litellm_internal_staging (214945a)1
Footnotes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant issues
Complements #33228 and #34058 (Codex CLI against
bedrock_mantle/Responses deployments)Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
All runs below were captured at commit d2b573c against the real OpenAI API (real spend), proxy booted with
Control at the same commit: a non-Codex client sending a param OpenAI does not accept still gets the normal error, so nothing changed for other clients
{"error":{"message":"litellm.UnsupportedParamsError: openai does not support parameters: ['thinking'], for model=gpt-5.6-sol. To drop these, set `litellm.drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params: true`\n...","code":"400"}}The identical body with a Codex user agent succeeds because the proxy now injects
drop_params: truefor it{"id":"chatcmpl-E3uvt26pRA1GDsOTQrxQuLOvn64R1","model":"gpt-5.6-sol","choices":[{"finish_reason":"stop","message":{"content":"ok","role":"assistant"}}]}Real Codex CLI end to end through the same proxy
Proxy debug log from those runs, showing the genuine Codex user agent and the injected flag
Type
🆕 New Feature
Changes
Claude Code user agents already get
drop_paramsenabled automatically by the proxy so client-specific params do not fail requests routed to providers that reject them. Codex has the same problem: since 0.144 it sendsservice_tier: "priority"whenever a speed tier is selected in~/.codex/config.toml, which some providers reject (Bedrock Mantle only acceptsautoanddefault, see #34058)This PR extends the existing mechanism to Codex.
is_codex_user_agentmatches the sharedcodex_prefix ofcodex_cli_rs/(TUI),codex_exec/(exec mode), andcodex_vscode/(IDE extension), andshould_auto_drop_params_for_claude_codeis renamed toshould_auto_drop_params_for_agentic_cliand covers both clients. Precedence is unchanged: an explicitdrop_paramsfrom the caller or in the operator'slitellm_settingsalways wins over the default, and non-matching user agents are untouchedTogether with #33228 and #34058 this makes Codex against
bedrock_mantle/Responses deployments work with zero extra proxy configurationFinal Attestation