diff --git a/src/models.ts b/src/models.ts index 86fe17d1..29a38893 100644 --- a/src/models.ts +++ b/src/models.ts @@ -478,7 +478,10 @@ export function getShortModelName(model: string): string { const claude = deriveClaudeShortName(canonical) if (claude) return claude for (const [key, name] of SORTED_SHORT_NAMES) { - if (canonical.startsWith(key)) return name + // Match on a version boundary, not a bare prefix: an unlisted future minor + // (e.g. gpt-5.6) must NOT collapse into the base "gpt-5" entry — it should + // fall through to its raw id rather than show a wrong name/tier. + if (canonical === key || canonical.startsWith(key + '-')) return name } return canonical } diff --git a/src/providers/codex.ts b/src/providers/codex.ts index 3e1f3274..a97328df 100644 --- a/src/providers/codex.ts +++ b/src/providers/codex.ts @@ -23,6 +23,10 @@ const modelDisplayNames: Record = { 'gpt-4o': 'GPT-4o', } +// Longest-first + version-boundary match so an unlisted future minor (gpt-5.6) +// falls through to its raw id instead of collapsing into the base "GPT-5" entry. +const modelDisplayEntries = Object.entries(modelDisplayNames).sort((a, b) => b[0].length - a[0].length) + const toolNameMap: Record = { exec_command: 'Bash', read_file: 'Read', @@ -589,8 +593,8 @@ export function createCodexProvider(codexDir?: string): Provider { displayName: 'Codex', modelDisplayName(model: string): string { - for (const [key, name] of Object.entries(modelDisplayNames)) { - if (model.startsWith(key)) return name + for (const [key, name] of modelDisplayEntries) { + if (model === key || model.startsWith(key + '-')) return name } return model },