Skip to content

Commit b3ed53d

Browse files
author
shentao6
committed
fix(models): keep gpt-5.3-codex-spark on its own display line (fix #461)
gpt-5.3-codex-spark is a distinct Codex model variant, but both getShortModelName() and Codex's own modelDisplayName() collapsed it into the base "GPT-5.3 Codex" label via the longest-prefix fallback (longest-first sort + "key + '-'" boundary match). Add explicit gpt-5.3-codex-spark entries to both SHORT_NAMES and Codex's modelDisplayNames, sorted before gpt-5.3-codex so the more specific id wins. Regression tests cover both the shared resolver and the Codex provider's per-provider display name.
1 parent 04f3fc1 commit b3ed53d

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ const SHORT_NAMES: Record<string, string> = {
617617
'gpt-5.4-nano': 'GPT-5.4 Nano',
618618
'gpt-5.4-mini': 'GPT-5.4 Mini',
619619
'gpt-5.4': 'GPT-5.4',
620+
'gpt-5.3-codex-spark': 'GPT-5.3 Codex Spark',
620621
'gpt-5.3-codex': 'GPT-5.3 Codex',
621622
'gpt-5.3': 'GPT-5.3',
622623
'gpt-5.2-pro': 'GPT-5.2 Pro',

src/providers/codex.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const modelDisplayNames: Record<string, string> = {
1616
'gpt-5.5': 'GPT-5.5',
1717
'gpt-5.4-mini': 'GPT-5.4 Mini',
1818
'gpt-5.4': 'GPT-5.4',
19+
'gpt-5.3-codex-spark': 'GPT-5.3 Codex Spark',
1920
'gpt-5.3-codex': 'GPT-5.3 Codex',
2021
'gpt-5.2-low': 'GPT-5.2 Low',
2122
'gpt-5.2': 'GPT-5.2',

tests/models.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ describe('getShortModelName', () => {
6161
expect(getShortModelName('claude-opus-4-8')).toBe('Opus 4.8')
6262
})
6363

64+
// Regression for #461: gpt-5.3-codex-spark must keep its own display name
65+
// rather than collapsing into the shorter gpt-5.3-codex bucket.
66+
it('maps gpt-5.3-codex-spark to its own line (not GPT-5.3 Codex)', () => {
67+
expect(getShortModelName('gpt-5.3-codex-spark')).toBe('GPT-5.3 Codex Spark')
68+
})
69+
6470
// A future version is derived from the id with no hand-maintained entry.
6571
it('derives an unreleased claude version with no SHORT_NAMES entry', () => {
6672
expect(getShortModelName('claude-sonnet-5-2')).toBe('Sonnet 5.2')

tests/providers/codex.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,3 +493,15 @@ describe('codex provider - forked session dedupe', () => {
493493
expect(tokens).toBe(300)
494494
})
495495
})
496+
497+
describe('codex provider - modelDisplayName', () => {
498+
it('maps gpt-5.3-codex-spark to its own display name (not GPT-5.3 Codex) - fix #461', () => {
499+
const provider = createCodexProvider('/nonexistent/path')
500+
expect(provider.modelDisplayName('gpt-5.3-codex-spark')).toBe('GPT-5.3 Codex Spark')
501+
})
502+
503+
it('still maps the base gpt-5.3-codex to GPT-5.3 Codex', () => {
504+
const provider = createCodexProvider('/nonexistent/path')
505+
expect(provider.modelDisplayName('gpt-5.3-codex')).toBe('GPT-5.3 Codex')
506+
})
507+
})

0 commit comments

Comments
 (0)