fix: always show friendly model names in all display locations#828
Merged
Conversation
- 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>
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.
Problem
Several new models were appearing in lowercase (raw model IDs) instead of friendly names:
Root cause
Two separate issues:
\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.
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()\
Testing