models: name GPT-5.6, Grok 4.5 and ClinePass slugs instead of showing raw ids - #893
Conversation
… raw ids Several model ids price correctly but had no SHORT_NAMES entry, so the By Model panel rendered the raw slug next to properly named siblings: `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `grok-4.5`, `qwen3.7-max`, `minimax-m3` and `mimo-v2.5-pro`. All display-only; no dollar amounts move. Notes on the less obvious ones: - The GPT-5.6 variants are listed individually rather than as a bare `gpt-5.6`. A base entry would swallow every future `gpt-5.6-*` through the prefix match and hide the variant behind a sibling's label, which is exactly what getShortModelName's version-boundary rule prevents. An unlisted variant still falls through to its raw id, and there is a test pinning that. - `grok-4.5` is the model the Grok Build harness runs and reports as `current_model_id`, so it takes the model's own name. Ids that really are `grok-build*` keep the "Grok Build" label, also covered by a test. - ClinePass routes models as `cline-pass/<slug>`. No new prefix handling was needed: getShortModelName's path fallback already strips the prefix and re-resolves the bare slug, the same way it handles `accounts/fireworks/models/<slug>`. - MiniMax M3 is mapped under both the lowercase OpenRouter slug and the capitalized spelling sessions report, since SHORT_NAMES matching is case-sensitive (the case-insensitive index covers pricing only). `mimo-v2.5-pro` remains unpriced upstream; this only gives it a name.
943ceb1 to
572c992
Compare
|
Maintainer note: the |
ozymandiashh
left a comment
There was a problem hiding this comment.
Verified locally (CI here does not run tests): 150/150 in models.test.ts, tsc clean. Display-only, each non-obvious mapping decision is argued in a comment and pinned by a test - the variant-collapse guard for gpt-5.6-*, the model-vs-harness split for grok-4.5, the path fallback for cline-pass/ slugs and the case-duplicate for MiniMax. Merging.
Summary
SHORT_NAMESentries for model ids that price correctly but had no display entry, so the By Model panel rendered a raw slug next to properly named siblings:gpt-5.6-sol,gpt-5.6-terra,gpt-5.6-luna,grok-4.5,qwen3.7-max,minimax-m3,mimo-v2.5-pro.mimo-v2.5-prois unpriced upstream both before and after; this only gives it a name).Before / after, from a real local report:
Notes on the non-obvious ones
GPT-5.6 variants are listed individually, not as a bare
gpt-5.6. A base entry would swallow every futuregpt-5.6-*via the prefix match and hide the variant behind a sibling's label — precisely whatgetShortModelName's version-boundary rule exists to prevent. An unlisted variant still falls through to its raw id, and a test pins that.grok-4.5is the model, not the harness. The Grok Build CLI reports the model it runs ascurrent_model_id, so the id takes the model's own name. Ids that really aregrok-build*keep the "Grok Build" label — also covered by a test, since that distinction is easy to regress.ClinePass needed no new prefix handling. Its ids arrive as
cline-pass/<slug>;getShortModelName's path fallback already strips the prefix and re-resolves the bare slug, exactly as it does foraccounts/fireworks/models/<slug>. Adding a dedicated prefix rule would have been dead code. Tests cover thecline-pass/path so the behavior stays intentional rather than incidental.MiniMax M3 is mapped under both spellings. The gap-filled OpenRouter key is the lowercase slug while sessions report the capitalized name;
SHORT_NAMESmatching is case-sensitive, and the case-insensitive index covers pricing only.Testing
npm testpassesnpm run buildsucceedsEvery id above was taken from real local sessions, not from documentation —
gpt-5.6-lunain particular only surfaced by grepping actual Codex transcripts (7 records), which is why it is included alongside the two obvious variants.npm test: 20 failed / 2619 passed against amainbaseline of 23 failed / 2612 passed on the same machine and commit base. No file fails here that does not also fail onmain; the failures are the pre-existingcache-refresh-lock/parserdurable-orphan /app/electron/cliset plus CLI-subprocess tests that flake under parallel load and pass in isolation. The 26 errors in both runs areapp/renderertests needingjsdomfromapp/'s own dependency tree.Five new assertions in
tests/models.test.tscover the variant-collapse guard, the Grok Build distinction, thecline-pass/path fallback, and both MiniMax spellings.