fix: normalize legacy Claude Code model IDs for image capabilities#5968
Conversation
🦋 Changeset detectedLatest commit: 222fdd8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #4573 where Claude Opus 4.5 with the dated model ID claude-opus-4-5-20251101 incorrectly showed "Does not support images" in the Claude Code provider. The fix ensures that legacy dated Claude Code model IDs are normalized to their canonical forms before accessing model metadata, preventing capability mismatches.
Changes:
- Added model ID normalization in the Claude Code API handler using
normalizeClaudeCodeModelId() - Added regression tests to verify dated model IDs resolve to correct canonical models with proper capabilities
- Ensured consistency between backend provider and frontend model selection hooks
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/api/providers/claude-code.ts | Added normalization of model IDs in getModel() method to handle legacy dated model IDs |
| src/api/providers/tests/claude-code.spec.ts | Added test case verifying dated model IDs normalize correctly with proper image support |
| webview-ui/src/components/ui/hooks/tests/useSelectedModel.spec.ts | Added test case verifying webview properly normalizes dated Claude Code model IDs |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The PR cleanly integrates Key observations:
Files Reviewed (4 files)
|
Summary
ormalizeClaudeCodeModelId
Why
Claude Code legacy dated model IDs can surface in persisted settings. Normalizing them consistently prevents capability mismatches and keeps image support flags correct.
Fixes #4573