fix: match Claude model ids in vision capability overrides - #764
Open
chiruu12 wants to merge 1 commit into
Open
Conversation
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.
Summary
MODEL_OVERRIDESkeyed vision support onclaude-3andclaude-4. Anthropic moved toclaude-<family>-<version>after Claude 3, so nothing is namedclaude-4-*and that entry matched no model id.Every Claude model from Sonnet 4 onward therefore fell through to the binding default. On
binding="custom"that default issupports_vision: False, with the comment "Per-model; set True via MODEL_OVERRIDES", so image input was reported unsupported for all of them, includingAnthropicProvider.default_model(claude-sonnet-4-20250514).Before:
Only the legacy Claude 3 naming still matched.
Fix
Replace both version-keyed entries with a single
claude-prefix. Enumerating versions is what drifted here, and every Claude model from 3 onward is multimodal. A future text-only model can be excluded with a longer, more specific key, sinceget_capabilitysorts patterns by length and the most specific one wins.Tests
test_claude_model_ids_are_vision_capablecovers the current ids across Claude 3, 4, 4.6 and 5.test_claude_override_does_not_leak_to_other_vendorspins that the broader prefix doesn't affectgpt-3.5orgemma. The first fails ondevand passes with the change.Ruff check, ruff format and mypy are clean on both files.