Repository navigation
fix(bedrock): stop sending reasoning effort none to GPT-6 Astra when /v1/messages disables thinking - #42854
fix(bedrock): stop sending reasoning effort none to GPT-6 Astra when /v1/messages disables thinking#42854kimnamu wants to merge 3 commits into
Conversation
…/v1/messages disables thinking
The /v1/messages bridge turns Anthropic thinking {"type": "disabled"} into
reasoning_effort "none" for every non-Claude target. Bedrock GPT-6 Astra has
no "none" level and answers 400, although its map rows already say
supports_none_reasoning_effort: false. Skip "none" when the target's row
explicitly disables it, so the request runs at the model's default effort
The Bedrock GPT-6 Sol and Luna rows copied Astra's false flag, but both take
"none" on Converse and on the runtime and Mantle OpenAI endpoints, as
OpenAI's own gpt-6-sol and gpt-6-luna rows say. Set it to true there so they
keep getting "none"
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
lets-order-some-fries
left a comment
There was a problem hiding this comment.
I built a reproduction for #42853 at main 571ada0b0f before this PR and re-ran it at head c6c70f68f9 (offline; adapter plus Converse param mapping only, no provider calls). Before:
bedrock/us.openai.gpt-6-astra cost_map_flag=False supports_none()=False adapter->reasoning_effort='none' converse_wire={'effort': 'none'}
after:
bedrock/us.openai.gpt-6-astra cost_map_flag=False supports_none()=False adapter->reasoning_effort=None converse_wire=None
all 3 of 3 Astra targets. bedrock/converse/us.openai.gpt-5.6-sol (cost_map_flag=None) still gets 'none'.
That looks like the root cause, not a patch over it: the gate reads the capability flag where disabled thinking is translated, litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py:1168-1169, and is_explicitly_disabled_factory rather than the boolean helper is what leaves the unflagged row alone.
Two questions:
azure/gpt-6-astra,azure/us/gpt-6-astraandazure_ai/gpt-6-astracarrysupports_none_reasoning_effort: truewhileopenai/gpt-6-astracarriesfalse; at your head I still getreasoning_effort='none'for all three. Do those rows need the same correction? I have no Azure keys, so I cannot say which value is right.reasoning_effort_from_thinking_budget(litellm/litellm_core_utils/reasoning_effort_utils.py:20-26) floors at"minimal"one branch above the new check, and everygpt-6/gpt-5.6row across all five providers setssupports_minimal_reasoning_effort: false. Withbudget_tokens0/512/1023 I get{'effort': 'minimal'}on the wire. Doesminimalneed gating too, asVertexGeminiConfig._supports_minimal_thinking_leveldoes?
Tests at your head: the adapter transformation file, 229 passed, 0 failed; test_model_prices_schema.py plus test_cost_map_guard.py, 85 passed, 0 failed. I did not run the wider bedrock/ or router_utils/ suites the PR body quotes.
|
Thanks @lets-order-some-fries for rebuilding the repro at both hashes. As far as I can tell neither question needs a change here
Did you see Budgets 0 and 1023, other providers, and a local proxy run |
|
My review was wrong about Re-run at
On your question, The Azure answer holds: #39827 quotes Foundry's own error listing This looks right to me. The adapter transformation test file passes at |
Thanks for the
/v1/messagesthinking translation and for the per-modelsupports_none_reasoning_effortflags, which this readsTLDR
Problem this solves:
/v1/messagesdisables thinkingnone, which Astra lacksnoneHow it solves it:
nonewhen the target's row says unsupportednoneeb7eeb5419)c6c70f68f9)/v1/messages, thinking disabled, GPT-6 Astrabedrock/us.,bedrock/global.andbedrock_mantle/in us-west-2, plain and streamingnonesent/v1/messages, thinking enabled or left out, every model abovereasoning_effort: "none", GPT-6 Astra/v1/responses,bedrock/us.openai.gpt-6-solorbedrock/global.openai.gpt-6-luna, effortnonewithtemperature: 0.2low, and GPT-6 Astra with effortlowDetails
Before mapping disabled thinking to
none, the Anthropic adapter now checks the target'ssupports_none_reasoning_effortwith the existingis_explicitly_disabled_factory, so only an explicit false skips it and unflagged targets keepnone. This mirrorsmaybe_drop_disabled_thinking, which already drops disabled thinking for Claude models that always think. The Bedrock GPT-6 Sol and Luna rows from #42746 and #42798 copied Astra'sfalse. They now saytrue, like OpenAI'sgpt-6-solandgpt-6-lunarowspytest -n 4tests/test_litellm/llms/anthropic/experimental_pass_throughtests/test_litellm/router_utilstests/test_litellm/llms/bedrocktests/test_litellm/llms/bedrock_mantletests/test_litellm/test_model_prices_schema.py,test_cost_map_guard.pyci_cd/cost_map_guard.pyUser Flow
Before: GPT-6 Astra fails on
/v1/messageswith thinking disabledgpt-6-astra,"thinking": {"type": "disabled"}After: the same request is answered
Relevant issues
Fixes #42853
Pre-Submission checklist
Screenshots / Proof of Fix
Live Bedrock calls through a local proxy
Before (eb7eeb5)
Messages, thinking disabled
Messages streaming, thinking disabled
Messages, thinking enabled or left out
Responses, effort with temperature 0.2
After (c6c70f6)
Messages, thinking disabled
Messages streaming, thinking disabled
Messages, thinking enabled or left out
Responses, effort with temperature 0.2
Type
🐛 Bug Fix
Caveats (if any)
Medium
nonefor 22 other flag-false rows toogpt-5variants, not run liveLow
Final Attestation