Skip to content

fix(bedrock): stop sending reasoning effort none to GPT-6 Astra when /v1/messages disables thinking - #42854

Open
kimnamu wants to merge 3 commits into
BerriAI:mainfrom
kimnamu:bedrock_gpt_6_astra_thinking_disabled
Open

kimnamu wants to merge 3 commits into
BerriAI:mainfrom
kimnamu:bedrock_gpt_6_astra_thinking_disabled

Conversation

@kimnamu

@kimnamu kimnamu commented Sep 24, 2026

Copy link
Copy Markdown

Thanks for the /v1/messages thinking translation and for the per-model supports_none_reasoning_effort flags, which this reads

TLDR

Problem this solves:

  • GPT-6 Astra gets a 400 when /v1/messages disables thinking
  • litellm sends reasoning effort none, which Astra lacks
  • Bedrock Sol and Luna rows wrongly say no none

How it solves it:

  • Skip none when the target's row says unsupported
  • Bedrock GPT-6 Sol and Luna rows now allow none
Before (eb7eeb5419) After (c6c70f68f9)
/v1/messages, thinking disabled, GPT-6 Astra bedrock/us., bedrock/global. and bedrock_mantle/ in us-west-2, plain and streaming 400 from Bedrock 200, no effort sent
same, GPT-6 Sol, Luna and GPT-5.6 Sol on Converse, GPT-6 Sol on Mantle 200, none sent unchanged
/v1/messages, thinking enabled or left out, every model above 200 unchanged
chat completions with explicit reasoning_effort: "none", GPT-6 Astra 400 from Bedrock unchanged
/v1/responses, bedrock/us.openai.gpt-6-sol or bedrock/global.openai.gpt-6-luna, effort none with temperature: 0.2 400 from litellm 200
same with effort low, and GPT-6 Astra with effort low 400 from litellm unchanged
Details

Before mapping disabled thinking to none, the Anthropic adapter now checks the target's supports_none_reasoning_effort with the existing is_explicitly_disabled_factory, so only an explicit false skips it and unflagged targets keep none. This mirrors maybe_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's false. They now say true, like OpenAI's gpt-6-sol and gpt-6-luna rows

# what reaches Bedrock, litellm.anthropic_interface.messages.create(..., thinking={"type": "disabled"}), before -> after
bedrock/us.openai.gpt-6-astra          /model/us.openai.gpt-6-astra/converse       reasoning {'effort': 'none'}, 400  ->  no reasoning field, ok
bedrock/global.openai.gpt-6-astra      /model/global.openai.gpt-6-astra/converse   reasoning {'effort': 'none'}, 400  ->  no reasoning field, ok
bedrock_mantle/openai.gpt-6-astra      /openai/v1/responses                        reasoning {'effort': 'none'}, 400  ->  no reasoning field, ok
bedrock/converse/us.openai.gpt-6-sol   /model/us.openai.gpt-6-sol/converse         reasoning {'effort': 'none'}, ok   ->  same
bedrock_mantle/openai.gpt-6-sol        /openai/v1/responses                        reasoning {'effort': 'none'}, ok   ->  same

# raw Bedrock, no litellm, runtime /openai/v1 (us-east-1) and Mantle (Sol and Luna in us-east-1, Astra in us-west-2)
reasoning effort none                      Sol 200  Luna 200  Astra 400 unsupported_value
reasoning effort none + temperature 0.2    Sol 200  Luna 200
reasoning effort low + temperature 0.2     Sol 400  Luna 400  Astra 400
# new test, adapter at eb7eeb5419 with the cost map change kept, then c6c70f68f9
$ pytest -p no:xdist -q tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_anthropic_experimental_pass_through_adapters_transformation.py -k sends_effort_none_only
FAILED ...[bedrock-gpt-6-astra-global]
FAILED ...[bedrock-gpt-6-astra]
FAILED ...[mantle-gpt-6-astra]
E       AssertionError: assert 'none' == None
3 failed, 4 passed, 222 deselected
7 passed, 222 deselected
# adapter change with eb7eeb5419's cost map: the Sol and Luna cases fail instead, 3 failed, 4 passed
pytest -n 4 Before After
tests/test_litellm/llms/anthropic/experimental_pass_through 979 passed 986 passed
tests/test_litellm/router_utils 632 passed 632 passed
tests/test_litellm/llms/bedrock 1445 passed 1445 passed
tests/test_litellm/llms/bedrock_mantle 227 passed 227 passed
tests/test_litellm/test_model_prices_schema.py, test_cost_map_guard.py 85 passed 85 passed
ruff strict, type discipline, test quality gates, ci_cd/cost_map_guard.py OK
basedpyright on the adapter no new diagnostics

User Flow

Before: GPT-6 Astra fails on /v1/messages with thinking disabled

  1. POST http://localhost:4000/v1/messages, model gpt-6-astra, "thinking": {"type": "disabled"}
  2. 400, "Unsupported value: 'none' is not supported"

After: the same request is answered

  1. Same POST
  2. 200, "pong"

Relevant issues

Fixes #42853

Pre-Submission checklist

  • Meaningful tests added
  • Covering test files pass locally
  • Required CI checks pass
  • Scope is one problem
  • Greptile Confidence Score of at least 4/5

Screenshots / Proof of Fix

Live Bedrock calls through a local proxy
# LITELLM_LOCAL_MODEL_COST_MAP=True python litellm/proxy/proxy_cli.py --config config.yaml --port 4000
model_list:
  - model_name: gpt-6-sol
    litellm_params: {model: bedrock/converse/us.openai.gpt-6-sol, aws_region_name: us-east-1}
  - model_name: gpt-6-luna
    litellm_params: {model: bedrock/converse/us.openai.gpt-6-luna, aws_region_name: us-east-1}
  - model_name: gpt-6-astra
    litellm_params: {model: bedrock/us.openai.gpt-6-astra, aws_region_name: us-east-1}
  - model_name: gpt-6-astra-global
    litellm_params: {model: bedrock/global.openai.gpt-6-astra, aws_region_name: us-east-1}
  - model_name: gpt-5.6-sol
    litellm_params: {model: bedrock/converse/us.openai.gpt-5.6-sol, aws_region_name: us-east-1}
  - model_name: mantle-gpt-6-sol
    litellm_params: {model: bedrock_mantle/openai.gpt-6-sol, aws_region_name: us-east-1}
  - model_name: mantle-gpt-6-astra
    litellm_params: {model: bedrock_mantle/openai.gpt-6-astra, aws_region_name: us-west-2}
  - model_name: gpt-6-sol-default
    litellm_params: {model: bedrock/us.openai.gpt-6-sol, aws_region_name: us-east-1}
  - model_name: gpt-6-luna-global
    litellm_params: {model: bedrock/global.openai.gpt-6-luna, aws_region_name: us-east-1}
general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY
H=(-H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json")
U=http://localhost:4000
OFF='"thinking":{"type":"disabled"},'
ON='"thinking":{"type":"enabled","budget_tokens":1024},'
msgs() { curl -s -o out.json -w '%{http_code} ' $U/v1/messages "${H[@]}" -d "{\"model\":\"$1\",\"max_tokens\":2048,$2\"messages\":[{\"role\":\"user\",\"content\":\"Say pong.\"}]}"; \
  jq -c 'if .error then (.error.message | .[0:200]) else ([.content[]? | "\(.type) \(.text // "")"] + [.stop_reason]) end' out.json; }
stream_msgs() { curl -sN -o out.txt -w '%{http_code} ' $U/v1/messages "${H[@]}" -d "{\"model\":\"$1\",\"max_tokens\":2048,\"stream\":true,$OFF\"messages\":[{\"role\":\"user\",\"content\":\"Say pong.\"}]}"; \
  if grep -q '^data: ' out.txt; then sed -n 's/^data: //p' out.txt | jq -rj 'if .type=="content_block_delta" then (.delta.text // "") elif .type=="message_stop" then " [message_stop]" else "" end'; else jq -rj '.error.message | .[0:200]' out.txt; fi; echo; }
resp() { curl -s -o out.json -w '%{http_code} ' $U/v1/responses "${H[@]}" -d "{\"model\":\"$1\",\"input\":\"Say pong.\",\"reasoning\":{\"effort\":\"$2\"},\"temperature\":0.2}"; \
  jq -c 'if .error then (.error.message | .[0:150]) else [.output[]? | select(.type=="message") | .content[0].text] end' out.json; }

Before (eb7eeb5)

Messages, thinking disabled

  1. Run
$ msgs gpt-6-astra "$OFF"
400 "litellm.BadRequestError: BedrockException - {\"message\":\"The model returned the following errors: {\\\"error\\\":{\\\"code\\\":\\\"unsupported_value\\\",\\\"message\\\":\\\"Unsupported value: 'none' is not supported wit"
$ msgs gpt-6-astra-global "$OFF"
400 "litellm.BadRequestError: BedrockException - {\"message\":\"The model returned the following errors: {\\\"error\\\":{\\\"code\\\":\\\"unsupported_value\\\",\\\"message\\\":\\\"Unsupported value: 'none' is not supported wit"
$ msgs mantle-gpt-6-astra "$OFF"
400 "litellm.BadRequestError: BedrockException - {\"error\":{\"code\":\"unsupported_value\",\"message\":\"Unsupported value: 'none' is not supported with the 'openai.gpt-6-astra' model. Supported values are: 'low',"
$ msgs gpt-6-sol "$OFF"
200 ["text pong","end_turn"]
$ msgs gpt-6-luna "$OFF"
200 ["text pong","end_turn"]
$ msgs gpt-5.6-sol "$OFF"
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-sol "$OFF"
200 ["text pong","end_turn"]

Messages streaming, thinking disabled

  1. Run
$ stream_msgs gpt-6-astra
400 litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: {\"error\":{\"code\":\"unsupported_value\",\"message\":\"Unsupported value: 'none' is not supported wit
$ stream_msgs gpt-6-astra-global
400 litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: {\"error\":{\"code\":\"unsupported_value\",\"message\":\"Unsupported value: 'none' is not supported wit
$ stream_msgs mantle-gpt-6-astra
400 litellm.BadRequestError: BedrockException - {"error":{"code":"unsupported_value","message":"Unsupported value: 'none' is not supported with the 'openai.gpt-6-astra' model. Supported values are: 'low',
$ stream_msgs gpt-6-sol
200 pong [message_stop]

Messages, thinking enabled or left out

  1. Run
$ msgs gpt-6-astra "$ON"
200 ["text pong","end_turn"]
$ msgs gpt-6-astra ""
200 ["text pong","end_turn"]
$ msgs gpt-6-astra-global "$ON"
200 ["text pong","end_turn"]
$ msgs gpt-6-astra-global ""
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-astra "$ON"
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-astra ""
200 ["text pong","end_turn"]
$ msgs gpt-6-sol "$ON"
200 ["text pong","end_turn"]
$ msgs gpt-6-sol ""
200 ["text pong","end_turn"]
$ msgs gpt-6-luna "$ON"
200 ["text pong","end_turn"]
$ msgs gpt-6-luna ""
200 ["text pong","end_turn"]
$ msgs gpt-5.6-sol "$ON"
200 ["text pong","end_turn"]
$ msgs gpt-5.6-sol ""
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-sol "$ON"
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-sol ""
200 ["text pong","end_turn"]

Responses, effort with temperature 0.2

  1. Run
$ resp gpt-6-sol-default none
400 "litellm.UnsupportedParamsError: us.openai.gpt-6-sol doesn't support temperature=0.2 while reasoning is active. Only temperature=1 is supported unless "
$ resp gpt-6-luna-global none
400 "litellm.UnsupportedParamsError: global.openai.gpt-6-luna doesn't support temperature=0.2 while reasoning is active. Only temperature=1 is supported un"
$ resp gpt-6-sol-default low
400 "litellm.UnsupportedParamsError: us.openai.gpt-6-sol doesn't support temperature=0.2 while reasoning is active. Only temperature=1 is supported unless "
$ resp gpt-6-astra low
400 "litellm.UnsupportedParamsError: us.openai.gpt-6-astra doesn't support temperature=0.2 while reasoning is active. Only temperature=1 is supported unles"

After (c6c70f6)

Messages, thinking disabled

  1. Run
$ msgs gpt-6-astra "$OFF"
200 ["text pong","end_turn"]
$ msgs gpt-6-astra-global "$OFF"
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-astra "$OFF"
200 ["text pong","end_turn"]
$ msgs gpt-6-sol "$OFF"
200 ["text pong","end_turn"]
$ msgs gpt-6-luna "$OFF"
200 ["text pong","end_turn"]
$ msgs gpt-5.6-sol "$OFF"
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-sol "$OFF"
200 ["text pong","end_turn"]

Messages streaming, thinking disabled

  1. Run
$ stream_msgs gpt-6-astra
200 pong [message_stop]
$ stream_msgs gpt-6-astra-global
200 pong [message_stop]
$ stream_msgs mantle-gpt-6-astra
200 pong [message_stop]
$ stream_msgs gpt-6-sol
200 pong [message_stop]

Messages, thinking enabled or left out

  1. Run
$ msgs gpt-6-astra "$ON"
200 ["text pong","end_turn"]
$ msgs gpt-6-astra ""
200 ["text pong","end_turn"]
$ msgs gpt-6-astra-global "$ON"
200 ["text pong","end_turn"]
$ msgs gpt-6-astra-global ""
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-astra "$ON"
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-astra ""
200 ["text pong","end_turn"]
$ msgs gpt-6-sol "$ON"
200 ["text pong","end_turn"]
$ msgs gpt-6-sol ""
200 ["text pong","end_turn"]
$ msgs gpt-6-luna "$ON"
200 ["text pong","end_turn"]
$ msgs gpt-6-luna ""
200 ["redacted_thinking ","text pong","end_turn"]
$ msgs gpt-5.6-sol "$ON"
200 ["text pong","end_turn"]
$ msgs gpt-5.6-sol ""
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-sol "$ON"
200 ["text pong","end_turn"]
$ msgs mantle-gpt-6-sol ""
200 ["text pong","end_turn"]

Responses, effort with temperature 0.2

  1. Run
$ resp gpt-6-sol-default none
200 ["pong"]
$ resp gpt-6-luna-global none
200 ["pong"]
$ resp gpt-6-sol-default low
400 "litellm.UnsupportedParamsError: us.openai.gpt-6-sol doesn't support temperature=0.2 while reasoning is active. Only temperature=1 is supported unless "
$ resp gpt-6-astra low
400 "litellm.UnsupportedParamsError: us.openai.gpt-6-astra doesn't support temperature=0.2 while reasoning is active. Only temperature=1 is supported unles"

Type

🐛 Bug Fix

Caveats (if any)

Medium

  • Disabled thinking skips none for 22 other flag-false rows too
    • Mostly OpenAI and Azure gpt-5 variants, not run live

Low

  • Astra still reasons at default when thinking is disabled

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

…/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"
@greptile-apps

greptile-apps Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with the compatibility check scoped to translated disabled thinking and backed by targeted model coverage

Summary

This PR prevents Anthropic Messages requests with disabled thinking from forwarding unsupported reasoning_effort: "none" to models that explicitly reject it

  • Uses model capability metadata rather than hardcoded model names
  • Corrects GPT-6 Sol and Luna capability rows in both synchronized cost maps
  • Adds focused regression coverage for Astra, Sol, Luna, Converse aliases, Mantle, and models without an explicit flag

Reviews (1) · Last reviewed commit: "fix(bedrock): stop sending reasoning eff..."

@codspeed

codspeed Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing kimnamu:bedrock_gpt_6_astra_thinking_disabled (5579ce9) with main (7a7d27c)

Open in CodSpeed

@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@lets-order-some-fries lets-order-some-fries left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-astra and azure_ai/gpt-6-astra carry supports_none_reasoning_effort: true while openai/gpt-6-astra carries false; at your head I still get reasoning_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 every gpt-6/gpt-5.6 row across all five providers sets supports_minimal_reasoning_effort: false. With budget_tokens 0/512/1023 I get {'effort': 'minimal'} on the wire. Does minimal need gating too, as VertexGeminiConfig._supports_minimal_thinking_level does?

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.

@kimnamu

kimnamu commented Sep 25, 2026

Copy link
Copy Markdown
Author

Thanks @lets-order-some-fries for rebuilding the repro at both hashes. As far as I can tell neither question needs a change here

Question What I found Checked with
Azure and Foundry Astra rows allow none Measured on Foundry in #39827 and #39983, which list none as supported there. OpenAI's API rejects it for Astra, hence the false on OpenAI's row Their PR bodies, no Azure keys here either
minimal below a 1024 budget Already handled: _normalize_reasoning_effort (adapters/handler.py:587) runs after the adapter and lowers it to low from supports_minimal_reasoning_effort. It skips none by design, so that one needs the adapter check Output below, the 36 live calls here all returned 200
# c6c70f68f9, /v1/messages with thinking {"type": "enabled", "budget_tokens": 512}
# adapter alone, then the handler step, then a live call with the outgoing body captured
bedrock/us.openai.gpt-6-astra           512   adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock/converse/us.openai.gpt-6-sol    512   adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock/converse/us.openai.gpt-6-luna   512   adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock/converse/us.openai.gpt-5.6-sol  512   adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock_mantle/openai.gpt-6-sol         512   adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock_mantle/openai.gpt-6-astra       512   adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
normalize_reasoning_effort_value('none', 'bedrock/us.openai.gpt-6-astra') = 'none'
normalize_reasoning_effort_value('none', 'bedrock_mantle/openai.gpt-6-astra') = 'none'

Did you see minimal on a path that skips that handler? Happy to look if so

Budgets 0 and 1023, other providers, and a local proxy run
# same run, budget_tokens 0 and 1023
bedrock/us.openai.gpt-6-astra           0     adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock/us.openai.gpt-6-astra           1023  adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock/converse/us.openai.gpt-6-sol    0     adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock/converse/us.openai.gpt-6-sol    1023  adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock/converse/us.openai.gpt-6-luna   0     adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock/converse/us.openai.gpt-6-luna   1023  adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock/converse/us.openai.gpt-5.6-sol  0     adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock/converse/us.openai.gpt-5.6-sol  1023  adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock_mantle/openai.gpt-6-sol         0     adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock_mantle/openai.gpt-6-sol         1023  adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock_mantle/openai.gpt-6-astra       0     adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
bedrock_mantle/openai.gpt-6-astra       1023  adapter='minimal' handler='low'  live=200 sent={'reasoning': {'effort': 'low'}}
# offline, the helper that both the chat and the Responses /v1/messages handlers call
normalize_reasoning_effort_value('minimal', 'gpt-6-astra') = 'low'
normalize_reasoning_effort_value('minimal', 'gpt-6-sol') = 'low'
normalize_reasoning_effort_value('minimal', 'azure/gpt-6-astra') = 'low'
normalize_reasoning_effort_value('minimal', 'azure/gpt-6-sol') = 'low'
normalize_reasoning_effort_value('minimal', 'azure_ai/gpt-6-astra') = 'low'
normalize_reasoning_effort_value('minimal', 'bedrock/us.openai.gpt-6-astra') = 'low'
normalize_reasoning_effort_value('minimal', 'bedrock/converse/us.openai.gpt-5.6-sol') = 'low'
normalize_reasoning_effort_value('minimal', 'bedrock_mantle/openai.gpt-6-luna') = 'low'
# proxy at c6c70f68f9 with a subset of the PR body's deployments and no drop_params, H as in the PR body
msgs() { curl -s -o out.json -w '%{http_code} ' $U/v1/messages "${H[@]}" -d "{\"model\":\"$1\",\"max_tokens\":2048,\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":$2},\"messages\":[{\"role\":\"user\",\"content\":\"Say pong.\"}]}"; \
  jq -c 'if .error then (.error.message | .[0:200]) else ([.content[]? | "\(.type) \(.text // "")"] + [.stop_reason]) end' out.json; }
$ for m in gpt-6-astra gpt-6-sol gpt-6-luna gpt-5.6-sol mantle-gpt-6-sol mantle-gpt-6-astra; do for b in 0 512 1023; do echo "\$ msgs $m $b"; msgs $m $b; done; done > out.txt
$ paste -d' ' - - < out.txt | sed 's/^\$ msgs //'
gpt-6-astra 0 200 ["text pong","end_turn"]
gpt-6-astra 512 200 ["text pong","end_turn"]
gpt-6-astra 1023 200 ["text pong","end_turn"]
gpt-6-sol 0 200 ["text pong","end_turn"]
gpt-6-sol 512 200 ["text pong","end_turn"]
gpt-6-sol 1023 200 ["text pong","end_turn"]
gpt-6-luna 0 200 ["text pong","end_turn"]
gpt-6-luna 512 200 ["text pong","end_turn"]
gpt-6-luna 1023 200 ["text pong","end_turn"]
gpt-5.6-sol 0 200 ["text pong","end_turn"]
gpt-5.6-sol 512 200 ["text pong","end_turn"]
gpt-5.6-sol 1023 200 ["text pong","end_turn"]
mantle-gpt-6-sol 0 200 ["text pong","end_turn"]
mantle-gpt-6-sol 512 200 ["text pong","end_turn"]
mantle-gpt-6-sol 1023 200 ["text pong","end_turn"]
mantle-gpt-6-astra 0 200 ["text pong","end_turn"]
mantle-gpt-6-astra 512 200 ["text pong","end_turn"]
mantle-gpt-6-astra 1023 200 ["text pong","end_turn"]

@lets-order-some-fries

Copy link
Copy Markdown

My review was wrong about minimal: the repro called the adapter and the Converse param mapping directly, so it never went through adapters/handler.py:587, and /v1/messages does not send it.

Re-run at ebcb314a19 through the public entry points, offline, with the request body captured at the HTTP client, for bedrock/us.openai.gpt-6-astra, bedrock/converse/us.openai.gpt-6-sol and bedrock_mantle/openai.gpt-6-astra. Effort sent:

entry point budget_tokens 0 / 512 / 1023 thinking disabled, both Astra targets
litellm.anthropic_interface.messages.create / acreate low not sent
litellm.adapter_completion / aadapter_completion with AnthropicAdapter minimal not sent

On your question, adapter_completion does skip the handler: it translates and goes straight to completion() (litellm/main.py:7712-7714, async at 7673-7675). It only applies when AnthropicAdapter is registered in litellm.adapters, which is empty by default (litellm/__init__.py:1503), and it sends minimal at main 14f4c34c61 too, so it is outside this PR. Your check sits in the shared adapter, so it covers that path as well: at main both entry points send none to Astra, at ebcb314a19 neither does.

The Azure answer holds: #39827 quotes Foundry's own error listing 'none' as a supported value for Astra, and #39983 shows none with temperature returning 200 on the azure_ai/ route.

This looks right to me. The adapter transformation test file passes at ebcb314a19 (234 passed).

This branch has not been deployed

No deployments
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]: Bedrock GPT-6 Astra returns 400 on /v1/messages when thinking is disabled

2 participants