Skip to content

fix: always show friendly model names in all display locations#828

Merged
rajbos merged 1 commit into
mainfrom
rajbos/fix-model-friendly-names
May 9, 2026
Merged

fix: always show friendly model names in all display locations#828
rajbos merged 1 commit into
mainfrom
rajbos/fix-model-friendly-names

Conversation

@rajbos
Copy link
Copy Markdown
Owner

@rajbos rajbos commented May 9, 2026

Problem

Several new models were appearing in lowercase (raw model IDs) instead of friendly names:

  • \claude-opus-4.7\ instead of 'Claude Opus 4.7' (details panel, chart)
  • \gpt-5.4\ instead of 'GPT-5.4' (details panel, chart)
  • \claude-sonnet-4.6\ instead of 'Claude Sonnet 4.6' (file viewer turn badge)
  • Sub-agent model badges also showed raw IDs

Root cause

Two separate issues:

  1. \modelUtils.ts\ had a hardcoded table that didn't include newer models. Every time a new model was added to \modelPricing.json\ via the nightly refresh, it had to be manually added here too — and it wasn't.

  2. The logviewer's turn model badge (
    enderTurnModelBadge) and sub-agent model badge weren't calling \getModelDisplayName()\ at all.

Fix

\modelUtils.ts\ — derived from \modelPricing.json\ (root cause fix)

Replaced the hardcoded table with dynamic derivation from \modelPricing.json. The first \displayNames\ entry for each model is used as the canonical friendly name. This means the nightly JSON refresh automatically keeps display names in sync.

\modelPricing.json\ — added missing \displayNames\

Added \displayNames\ to every model that was missing them (claude-opus series, haiku, gpt-5.x series, gemini flash variants, grok, raptor-mini, etc.)

\logviewer/main.ts\ — use friendly names


  • enderTurnModelBadge()\ now calls \getModelDisplayName()\
  • Sub-agent model badge now calls \getModelDisplayName()\

Testing

  • All 47 unit tests pass
  • Build succeeds

- Refactor getModelDisplayName() in modelUtils.ts to derive display
  names from modelPricing.json instead of a separate hardcoded table.
  This means the nightly JSON refresh automatically keeps display names
  in sync — no more models appearing as lowercase IDs.

- Add displayNames to all models in modelPricing.json that were missing
  them: claude-opus-4.5/4.6, claude-haiku/4.5, claude-opus-4.1,
  claude-sonnet-4.5, claude-opus-4.6-fast variants, gpt-5.1/5.2/5.3
  series, gpt-5-mini, gpt-4.1-mini/nano, gemini 2.x/3-flash,
  grok-code-fast-1, raptor-mini, and others.

- Fix logviewer turn model badge (renderTurnModelBadge) to call
  getModelDisplayName() so claude-sonnet-4.6 and similar show as
  'Claude Sonnet 4.6' instead of the raw ID.

- Fix sub-agent model badge in logviewer to also use
  getModelDisplayName().

Fixes: claude-opus-4.7 and gpt-5.4 appearing in lowercase on the
details panel, chart per-model view, and file viewer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rajbos rajbos merged commit ff91c10 into main May 9, 2026
18 checks passed
@rajbos rajbos deleted the rajbos/fix-model-friendly-names branch May 9, 2026 12:29
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