Repository navigation
fix(bedrock): forward the server-side-fallback beta and drop it under drop_params where the model lacks it (lts/1.108.x) - #54386
Conversation
…tle and drop it under drop_params where the model lacks it Bedrock Invoke, Bedrock Mantle and Databricks Claude need server-side-fallback-2026-06-01 for a fallback-block history, so the bundled beta table forwards the June beta in their columns and nulls July, matching main Opus 4.1 rejects the June beta with 400 invalid beta flag. A supports_server_side_fallback capability, resolved from a claude-server-side-fallback cost-map rule (Claude 4.5 and newer) or the deployment's model_info, lets drop_params drop the beta on Bedrock Invoke and Mantle for a model that lacks it. Without drop_params the beta still goes through and Bedrock answers its own 400
…k beta drop warning
…N in the server-side-fallback beta check
…k_server_side_fallback_beta_lts_1_108_x
PR overviewNo security issues were found in this pull request. Reviews
|
[Medium impact] The PR appears safe to merge with no actionable issues found
|
|
bugbot run |
There was a problem hiding this comment.
✅ 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 8124aa5. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This brings the server-side-fallback beta fix from #53857 to lts/1.108.x, so a
/v1/messagesconversation that carries a Claude fallback block works on Bedrock Invoke and Bedrock Mantle there too. It is the LTS twin of #53857, which is merged, with every commit of it pickedOriginal
TLDR
Problem this solves:
/v1/messageswith afallbackblock in history 400s on Bedrock Invoke and Mantleserver-side-fallback-2026-06-01on bothHow it solves it:
bedrockandbedrock_mantlebeta columnsserver-side-fallback-2026-07-01null there, since both reject itsupports_server_side_fallbackcapability for Claude 4.5 and newerdrop_params, drop the June beta for models without itIntentional product change: Opus 4.1 on Bedrock Invoke with the June beta and no
drop_paramsnow gets the provider's 400invalid beta flag, as a direct call does. Withdrop_paramsthe beta is droppedUser Flow
Before: a developer replaying a conversation that hit a server-side fallback gets a 400 on Bedrock
anthropic-beta: server-side-fallback-2026-06-01fallbackcontent block, streaming or notInput tag 'fallback' found using 'type' does not match any of the expected tagsAfter: the same request answers 200, the same as calling the platform directly
fallbackhistory, streaming or notdrop_params: truethe proxy drops the beta and answers 200. Withoutdrop_paramsit answers the provider's 400invalid beta flagRelevant issues
LTS twin of #53857
Backport
Picks, every non-merge commit of #53857 through 2a70196
The merge commit 608f5cd on #53857 is not picked
The line has no Databricks
/v1/messagesmodule and nothing reads itsdatabricksbeta column, so main's Databricks drop check has nowhere to go. The column rows are still picked so the bundled table matches main. The line runs Bedrock/v1/messageson Python, so main's Rust Invoke drop check and its Rustbase_modellookup have no reader here. The merge of lts/1.108.x keeps oneSERVER_SIDE_FALLBACK_2026_06_01enum member, since the line added the same member in 42dea5bTests and make check
cargo test -p litellm-llms-types -p litellm-llms --lib -- beta bedrock_mantle: 200 passedmake checkpasses at 8124aa5Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreDelays 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
Both legs ran one proxy with 2 workers, a Redis and its own Postgres, calling real Bedrock (us-east-1), with
LITELLM_LOCAL_ANTHROPIC_BETA_HEADERS=TrueandLITELLM_LOCAL_MODEL_COST_MAP=Trueso each leg reads its own tree's beta table and cost map. Configs, payloads, every command and its full output are in the QA gistdrop_params, June beta, fallback historydrop_params, June beta, first turnExample calls
Before (595a02e)
Invoke, June beta, fallback history
Opus 4.1 Invoke,
drop_params, June beta, first turndrop_paramsdeployment with the June beta, which answers 200 since the line's table drops the betaAfter (8124aa5)
Invoke, June beta, fallback history
Opus 4.1 Invoke,
drop_params, June beta, first turnType
🐛 Bug Fix
Caveats (if any)
Copied from #53857, whose caveat review stopped at its 4-round cap, without its Databricks rows
High
drop_paramsnow answers 400 on Bedrock Invokedrop_paramsconvention, so setdrop_params: truedrop_paramsdrop_paramsanswers 400invalid beta flagthereLITELLM_LOCAL_ANTHROPIC_BETA_HEADERS=TrueMedium
drop_params, since the cost map lists no server-side fallback support for itmodel_info.supports_server_side_fallback: truebase_modellookup for a profile ARN has unit tests only, since no proxy route reaches the drop check with an ARN todayLow
/model/infogain asupports_server_side_fallbackkey, often nulldrop_params, as on maindb-and-spendunit job timed out twice in its 3 minute full-history checkout before any test ran, a known line CI issue that main fixed in ci(unit): stop the full history clone on the db-and-spend shard, fetch the schema merge base by sha #50120 (run, passing on #54342)Final Attestation
Bugbot summary