fix(bedrock): drop toolSpec.strict for four more Claude Converse ids - #39115
Open
pdecat wants to merge 1 commit into
Open
fix(bedrock): drop toolSpec.strict for four more Claude Converse ids#39115pdecat wants to merge 1 commit into
pdecat wants to merge 1 commit into
Conversation
Contributor
Contributor
Greptile SummaryThe PR marks additional Claude Haiku 4.5, Sonnet 4.5/4.6, and Opus 4.6 Bedrock entries as not supporting Converse strict tools.
Confidence Score: 5/5The PR appears safe to merge, with the new model metadata consistently applied and exercised by focused regression coverage. The Bedrock Converse helper consumes these capability flags on the intended transformation path, affected prefixed identifiers resolve to flagged entries, non-Anthropic-prefixed forms are already guarded as unsupported, and both cost maps remain synchronized.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds the strict-tools capability override to the intended Bedrock model and regional entries without leaving a reachable affected identifier uncovered. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the primary cost-map updates used by packaged local model metadata. |
| tests/test_litellm/litellm_core_utils/prompt_templates/test_bedrock_converse_strict_tools_opus_47_48.py | Moves the newly unsupported models to strict-removal coverage and verifies representative transformations and cost-map entries without weakening existing supported-model checks. |
Reviews (1): Last reviewed commit: "fix(bedrock): drop toolSpec.strict for f..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Bedrock Converse routes Haiku 4.5, Sonnet 4.5/4.6 and Opus 4.6 through the
same Anthropic-compatible validator as Opus 4.7/4.8 and Sonnet 4/5, but their
cost-map entries were never flagged, so `toolSpec.strict` is still forwarded
for them.
Forwarding `strict: true` makes the model compile the tool schema into a
constrained-decoding grammar, and that grammar rejects ordinary JSON Schema
keywords. A tool carrying `maxItems` on an array property then fails the whole
request:
BedrockException - {"message":"The model returned the following errors:
tools.1.custom: For 'array' type, property 'maxItems' is not supported"}
Neither field fails on its own, only the pair, which is why this surfaced as
a sudden breakage for tool-calling clients (Cline forks, Codex, MCP toolsets)
after upgrading across v1.90.0, where forwarding `toolSpec.strict` to Converse
was introduced. Reproduced against Bedrock for Haiku 4.5, Sonnet 4.6 and
Opus 4.6; Sonnet 4.5 is flagged as the remaining member of the same cohort.
Sets `bedrock_converse_supports_strict_tools: false` on all 30 Bedrock entries
for those four ids (bare, every region prefix, and the us-gov keys), matching
how Opus 4.7/4.8, Sonnet 4 and Sonnet 5 are already flagged, so the fix is data
rather than another hardcoded model pattern.
Two tests asserted the pre-fix behaviour and are updated: the strict-tools
regression suite listed Sonnet 4.5/4.6 and Opus 4.6 as models that keep the
field, and test_bedrock_tools_pt_strict_parameter used Sonnet 4.5 as its
example of a Claude id that forwards it, which is now Opus 4.5.
Fixes BerriAI#34388
pdecat
force-pushed
the
fix/bedrock-strict-tools-unflagged-claude-ids
branch
from
September 1, 2026 14:46
b5d017c to
dde0e60
Compare
This was referenced Sep 3, 2026
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.
Bedrock Converse routes Haiku 4.5, Sonnet 4.5/4.6 and Opus 4.6 through the same Anthropic-compatible validator as Opus 4.7/4.8 and Sonnet 4/5 (#31582), but their cost-map entries were never flagged, so
toolSpec.strictis still forwarded for them.Forwarding
strict: truemakes the model compile the tool schema into a constrained-decoding grammar, and that grammar rejects ordinary JSON Schema keywords. A tool carryingmaxItemson an array property then fails the whole request:Neither field fails on its own, only the pair. Measured through a proxy against Sonnet 4.6, two tools sent so the failing one is
tools.1:strictmaxItemsSo it surfaces as a sudden breakage for tool-calling clients that set
stricton their tools, on any upgrade crossing v1.90.0, wheretoolSpec.strictforwarding to Converse was introduced. Reproduced against Bedrock for Haiku 4.5, Sonnet 4.6 and Opus 4.6.Change
bedrock_converse_supports_strict_tools: falseon all 30 Bedrock entries for those four ids (bare key, every region prefix, the us-gov keys), inmodel_prices_and_context_window.jsonand its backup, matching how Opus 4.7/4.8, Sonnet 4 and Sonnet 5 are already flagged. No code changes: the gate is data, so the fix reaches deployments through the cost map rather than another hardcoded model pattern.test_bedrock_converse_strict_tools_opus_47_48.pyasserted the pre-fix behaviour for Sonnet 4.5/4.6 and Opus 4.6, listing them as models that acceptstrict, so those cases move to the "strict dropped" side and the cost-map assertions cover the new keys.66 passedlocally, plustests/test_litellm/test_model_prices_schema.pyandci_cd/check_files_match.py.Sonnet 4.5 has no separate repro of its own and is flagged as the remaining member of the same cohort. Happy to drop it if you would rather ship only reproduced ids.
Fixes #34388. Overlaps #34609, which flags two of these ids; this one covers all four and updates the test that contradicts them, so close whichever fits better.