Skip to content

fix: normalize legacy Claude Code model IDs for image capabilities#5968

Merged
kevinvandijk merged 3 commits intoKilo-Org:mainfrom
Olusammytee:fix/4573-claude-opus-45-image-support
Feb 21, 2026
Merged

fix: normalize legacy Claude Code model IDs for image capabilities#5968
kevinvandijk merged 3 commits intoKilo-Org:mainfrom
Olusammytee:fix/4573-claude-opus-45-image-support

Conversation

@Olusammytee
Copy link
Copy Markdown

Summary

  • normalize �piModelId in Claude Code handler using
    ormalizeClaudeCodeModelId
  • ensure legacy dated IDs (for example claude-opus-4-5-20251101) resolve to canonical Claude Code model metadata
  • add regression tests in extension and webview model selection hooks

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 18, 2026

🦋 Changeset detected

Latest commit: 222fdd8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Feb 21, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The PR cleanly integrates normalizeClaudeCodeModelId into the ClaudeCodeHandler.getModel() method, replacing the previous Object.hasOwn guard with the normalization function that handles legacy dated model IDs (e.g., claude-opus-4-5-20251101claude-opus-4-5). This preserves model capabilities like image support that were previously lost when dated aliases didn't match the canonical model map.

Key observations:

  • The .trim() addition on apiModelId is a good defensive improvement
  • The removal of the Object.hasOwn guard is safe because normalizeClaudeCodeModelId always returns a valid ClaudeCodeModelId (with fallback to default)
  • Both backend and frontend test coverage is included for the normalization behavior
  • The changeset is well-written and user-focused
Files Reviewed (4 files)
  • .changeset/calm-forks-pretend.md - Changeset
  • src/api/providers/__tests__/claude-code.spec.ts - New test for legacy model ID normalization
  • src/api/providers/claude-code.ts - getModel() updated to use normalizeClaudeCodeModelId
  • webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts - New test for UI hook normalization

Copy link
Copy Markdown
Contributor

@kevinvandijk kevinvandijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Opus 4.5 incorrectly shows "Does not support images" in Claude Code provider

3 participants