Skip to content

fix(ui): model pill shows bare family name for single-segment versions (opus-5) - #2074

Open
sadpandajoe wants to merge 1 commit into
mainfrom
fix-model-pill-single-version
Open

fix(ui): model pill shows bare family name for single-segment versions (opus-5)#2074
sadpandajoe wants to merge 1 commit into
mainfrom
fix-model-pill-single-version

Conversation

@sadpandajoe

Copy link
Copy Markdown
Contributor

Problem

The model pill in the message/session UI showed a bare family name (e.g. opus) instead of the versioned name when a single-segment model version was selected. The per-family regexes in getModelDisplayName required two version segments (opus-(\d)-(\d)), so ids like claude-opus-5 / claude-sonnet-5 fell through to the bare fallback, and claude-fable-5 (no branch at all) returned the raw id.

Before / After

Model id Before After
claude-opus-5 opus opus-5
claude-sonnet-5 sonnet sonnet-5
claude-fable-5 claude-fable-5 fable-5
claude-opus-4-8 opus-4.8 opus-4.8 (unchanged)
unknown id passthrough passthrough (unchanged)

Fix

  • Refactored the three near-duplicate branches into one small family loop (opus, sonnet, haiku, fable).
  • Regex now matches an optional minor segment -(\d+)(?:-(\d+))? → renders opus-5 with no minor, opus-4.8 with one. Two-segment behavior is preserved exactly.
  • Bare family name is used only when there are no version digits; unknown families pass through unchanged. Trailing suffixes like [1m] don't break matching.
  • Added modelDisplay.test.ts covering all cases.

Verification

  • vitest run on modelDisplay.test.ts — 5 passed
  • biome check + typecheck on touched files — clean

🤖 Generated with Claude Code

…s (opus-5)

Refactor getModelDisplayName into a single family loop that matches an
optional minor segment, so single-segment ids (claude-opus-5) render as
opus-5 while preserving major.minor (claude-opus-4-8 -> opus-4.8). Adds
fable to the handled families and covers all cases with a unit test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant