litellm/tests/unit/llms/bedrock
Siddharth 2a4f8b1d19
fix(bedrock): drop another model's signed thinking when replaying to a non-Claude Converse target (#50073)
* fix(bedrock/converse): omit reasoning signature for non-Anthropic models (#49969)

* test(bedrock): cover signed reasoning replay in mapped tests

* fix(bedrock): drop another model's signed thinking when replaying to a non-Claude Converse target

A signed thinking block from Claude replayed to a Converse model known not to be Claude, such as GPT-6 Luna or Nova 2, now leaves the request instead of going out as reasoningContent. Bedrock rejects that field on those models, so the whole request answered 400

A target that may still be Claude, such as an application inference profile ARN with no base_model, keeps the signed block, since Claude needs it on a tool-use continuation. Unsigned blocks keep the existing text path

The thinking-block error matcher added earlier on this branch is removed, because Converse and non-Claude Bedrock requests never reach that retry

* fix(bedrock): keep signed thinking for Claude behind a region prefix litellm does not list

ca. and in. inference profiles name Claude after a region prefix get_bedrock_cross_region_inference_regions does not have yet, so they counted as non-Claude and lost their signed thinking. The thinking-only turn test now pins the exact merged and continue-message shapes.

* fix(bedrock): limit the region-prefix Claude match to signed thinking and drop a dropped block's cache point

* fix(bedrock): drop Claude's bridged reasoning items before a Bedrock Responses API replay

* fix(bedrock_mantle): drop litellm-minted reasoning items before a Mantle Responses call

* test(integration): expect Bedrock and Bedrock Mantle Responses to drop minted reasoning

Bedrock and Bedrock Mantle answer 400 on a reasoning item litellm minted, so the
wire test now expects both to drop it, like OpenAI and Azure

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-06 03:15:49 -08:00
..
batches fix(bedrock): send batch jobs to a configured control-plane endpoint (#47260) 2026-10-20 12:30:16 -07:00
chat fix(bedrock): drop another model's signed thinking when replaying to a non-Claude Converse target (#50073) 2026-11-06 03:15:49 -08:00
count_tokens fix(proxy): count the context_management edits /v1/messages applies on every bridged provider (#49234) 2026-11-02 10:38:35 -08:00
embed fix(rate-limit): estimate embedding image and audio data URIs as media in TPM pre-call checks (#49831) 2026-11-03 22:06:59 +00:00
files feat(proxy)!: only let clients pick S3 buckets the admin allowed (#47496) 2026-11-06 02:50:15 +00:00
image test: move 81 legacy live tests in pass-through, spend, batches, audio, search, guardrails, image and ocr dirs offline (#45288) 2026-10-08 02:38:12 -07:00
image_edit refactor(types): replace Any with proven types in 137 files (#44478) 2026-10-05 11:01:45 -07:00
image_generation test: move the unit half of 126 mixed legacy files into tests/unit (#45090) 2026-10-07 14:07:43 -07:00
invoke_agent refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
messages fix(bedrock): forward the per-turn-control beta to Bedrock Invoke (#43086) 2026-11-05 22:29:17 -08:00
passthrough fix(guardrails): apply guardrail masks to Bedrock InvokeModel Claude requests and replies (#49947) 2026-11-04 23:12:50 +00:00
realtime fix(bedrock)!: fail a Nova Sonic realtime session whose Bedrock stream drops instead of closing 1000 (#49170) 2026-11-03 07:56:23 +00:00
rerank refactor(types): replace Any with proven types in 137 files (#44478) 2026-10-05 11:01:45 -07:00
responses fix(openai): warn when the GPT-5 reasoning effort gate drops a level under drop_params (#47761) 2026-10-29 04:46:29 -07:00
search fix(streaming): keep merged think tags balanced and split SSE lines only on CR/LF (#48755) 2026-10-28 17:00:29 -07:00
vector_stores test: migrate legacy unit dirs and unrun folders into tests/unit, tests/integration and tests/e2e (#45940) 2026-10-11 06:24:57 -07:00
__init__.py test(unit): make every tests/unit directory a package so pytest collection is unique 2026-09-20 11:50:59 +00:00
event_loop_probe.py test(bedrock): detect Vault reads on the event-loop thread (#47597) 2026-10-20 10:45:04 -07:00
slow_upstream.py fix(router)!: bound fake-streamed calls by the request timeout, not stream_timeout (#47162) 2026-10-17 22:08:02 +00:00
test_anthropic_beta_support.py refactor(llms): rename model-version transformation files to family names (#48509) 2026-10-26 18:53:16 -07:00
test_base_aws_llm.py revert(bedrock): restore STS identity probe behavior before #49763 (#49939) 2026-11-03 21:34:59 +00:00
test_bedrock_common_utils.py feat(proxy): give Codex accurate model entries for every model in /v1/models (#49825) 2026-11-05 19:31:32 -08:00
test_bedrock_model_listing.py fix(bedrock): list the account's invocable models behind bedrock/* when check_provider_endpoint is on (#43981) 2026-10-09 14:14:17 -07:00
test_bedrock_ssl_verify.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_claude_platform_provider.py fix(anthropic)!: drop beta-gated body fields under drop_params (#48793) 2026-10-29 06:25:31 -07:00
test_converse_context_management.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_cost_calculation.py fix(bedrock): price claude_platform calls from their own cost map rows (#48150) 2026-10-24 13:54:18 -07:00
test_cross_region_inference_profile_mapping.py feat(bedrock): serve gpt-5.6+ chat completions natively by default, with chat_completions/ opt-in for gpt-oss and grok (#44307) 2026-10-02 19:55:54 -07:00
test_guardrail_attachments.py fix(guardrails): scan or refuse attachments in the bedrock guardrail (#43383) 2026-10-10 16:48:37 -07:00
test_mantle.py fix(bedrock): send the anthropic-workspace-id header to Bedrock Mantle (#44173) 2026-10-02 21:12:33 -07:00
test_nova_imported_models.py fix(bedrock): route a Bedrock model id with no Invoke provider to Converse (#43290) 2026-10-30 06:27:59 -07:00
test_request_metadata.py refactor(llms): rename model-version transformation files to family names (#48509) 2026-10-26 18:53:16 -07:00
test_web_identity_session_policy.py fix(bedrock): grant sts:GetWebIdentityToken and sts:TagGetWebIdentityToken in web identity session policy for claude_platform (#46670) 2026-10-16 06:37:49 +00:00