Repository navigation
fix(anthropic): fall back to auto tool_choice for Opus 5.5, Sonnet 5.5, Fable 5.1 and Mythos 5.1 - #7511
Conversation
|
Thanks for this fix. One addition to consider before it merges: Claude Sonnet 5.5 ( With Happy to test the branch again once it's updated. |
…5, Fable 5.1 and Mythos 5.1 Claude Opus 5.5, Sonnet 5.5, Fable 5.1 and Mythos 5.1 reject a forced tool_choice (`any` or `tool`) with a 400. For these models, send `auto` instead, keep `disable_parallel_tool_use`, and log a warning once per LLM instance.
862a936 to
e6fc2ad
Compare
|
Re-tested at e6fc2ad against the live API, with |
Problem
LLM.chat()translates a forcedtool_choicethe same way for every model:"required"becomes{"type": "any"}and a named function becomes{"type": "tool", "name": ...}. Claude Opus 5.5, Sonnet 5.5, Fable 5.1 and Mythos 5.1 don't support forced tool use (Opus 5.5, Sonnet 5.5, Fable 5.1 and Mythos 5.1 migration guides), so on these models every such request fails with a 400:tool_choice: type "tool" and "any" are not supported for this model.AMD and keyterm detection force"required"on their own, so they fail on these models even when the app never sets a tool choice.Changes
For these four models a forced choice is now sent as
{"type": "auto"}, keepingdisable_parallel_tool_usewhen it's set, and the plugin logs a warning once perLLMinstance. Requests for all other models are unchanged. These models have no forced mode, so the model may now answer without calling a tool, or call a different tool than the one named.