Repository navigation
Conversation
Sonnet 5.5 rejects a forced toolChoice (any/tool) with a ValidationException, like Opus 5.5 and Fable 5.1. Add it to _MODELS_REJECTING_FORCED_TOOL_CHOICE. Co-Authored-By: Claude <noreply@anthropic.com>
2 tasks done
Contributor
Author
|
Thanks @longcw for reviewing #7411, which added the forced
Would you mind taking a look when you have a moment? If this isn't a priority right now, tell me and I'll close it to keep your queue clean. |
longcw
approved these changes
Nov 6, 2026
This branch has not been deployed
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.
Thanks for merging #7411 so quickly, @longcw. Claude Sonnet 5.5 rejects a forced
toolChoiceon Bedrock the same way Opus 5.5 does, but_MODELS_REJECTING_FORCED_TOOL_CHOICEonly listsclaude-opus-5-5andclaude-fable-5-1. Sotool_choice="required"or a named tool still goes out asany/tool, and Bedrock returns a 400. This addsclaude-sonnet-5-5to that tuple. The sampling-params gate already covers Sonnet 5.5 through itsclaude-sonnet-5substring.us.anthropic.claude-sonnet-5-5,tool_choice="required"ValidationException(400)auto, the model calledget_weatherget_weatherValidationException(400)auto, the model calledget_weatherautorequired→any, named →toolProblem
Fix
One entry in
_MODELS_REJECTING_FORCED_TOOL_CHOICE. The substring match doesn't reachclaude-sonnet-5, which still acceptsany(now covered bytest_forced_tool_choice_kept_for_other_models).Tests
RED on main (source reverted, new test rows kept) and live runs
Live, us-east-1,
aws.LLM(model="us.anthropic.claude-sonnet-5-5").chat(..., tools=[get_weather], tool_choice=...):