From 8e6c6c9f5821a8797640f23f3336276e6cf16541 Mon Sep 17 00:00:00 2001 From: fightingst <26620558+fightingst@users.noreply.github.com> Date: Fri, 12 Jun 2026 15:43:27 +0800 Subject: [PATCH] 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. --- src/models.ts | 1 + src/providers/codex.ts | 1 + tests/models.test.ts | 6 ++++++ tests/providers/codex.test.ts | 12 ++++++++++++ 4 files changed, 20 insertions(+) diff --git a/src/models.ts b/src/models.ts index d45a8aa5..42d20e01 100644 --- a/src/models.ts +++ b/src/models.ts @@ -617,6 +617,7 @@ const SHORT_NAMES: Record = { 'gpt-5.4-nano': 'GPT-5.4 Nano', 'gpt-5.4-mini': 'GPT-5.4 Mini', 'gpt-5.4': 'GPT-5.4', + 'gpt-5.3-codex-spark': 'GPT-5.3 Codex Spark', 'gpt-5.3-codex': 'GPT-5.3 Codex', 'gpt-5.3': 'GPT-5.3', 'gpt-5.2-pro': 'GPT-5.2 Pro', diff --git a/src/providers/codex.ts b/src/providers/codex.ts index 9182800e..775126ec 100644 --- a/src/providers/codex.ts +++ b/src/providers/codex.ts @@ -16,6 +16,7 @@ const modelDisplayNames: Record = { 'gpt-5.5': 'GPT-5.5', 'gpt-5.4-mini': 'GPT-5.4 Mini', 'gpt-5.4': 'GPT-5.4', + 'gpt-5.3-codex-spark': 'GPT-5.3 Codex Spark', 'gpt-5.3-codex': 'GPT-5.3 Codex', 'gpt-5.2-low': 'GPT-5.2 Low', 'gpt-5.2': 'GPT-5.2', diff --git a/tests/models.test.ts b/tests/models.test.ts index 40981c0a..490aa7b5 100644 --- a/tests/models.test.ts +++ b/tests/models.test.ts @@ -61,6 +61,12 @@ describe('getShortModelName', () => { expect(getShortModelName('claude-opus-4-8')).toBe('Opus 4.8') }) + // Regression for #461: gpt-5.3-codex-spark must keep its own display name + // rather than collapsing into the shorter gpt-5.3-codex bucket. + it('maps gpt-5.3-codex-spark to its own line (not GPT-5.3 Codex)', () => { + expect(getShortModelName('gpt-5.3-codex-spark')).toBe('GPT-5.3 Codex Spark') + }) + // A future version is derived from the id with no hand-maintained entry. it('derives an unreleased claude version with no SHORT_NAMES entry', () => { expect(getShortModelName('claude-sonnet-5-2')).toBe('Sonnet 5.2') diff --git a/tests/providers/codex.test.ts b/tests/providers/codex.test.ts index 3ef4c30c..2f9b48c7 100644 --- a/tests/providers/codex.test.ts +++ b/tests/providers/codex.test.ts @@ -493,3 +493,15 @@ describe('codex provider - forked session dedupe', () => { expect(tokens).toBe(300) }) }) + +describe('codex provider - modelDisplayName', () => { + it('maps gpt-5.3-codex-spark to its own display name (not GPT-5.3 Codex) - fix #461', () => { + const provider = createCodexProvider('/nonexistent/path') + expect(provider.modelDisplayName('gpt-5.3-codex-spark')).toBe('GPT-5.3 Codex Spark') + }) + + it('still maps the base gpt-5.3-codex to GPT-5.3 Codex', () => { + const provider = createCodexProvider('/nonexistent/path') + expect(provider.modelDisplayName('gpt-5.3-codex')).toBe('GPT-5.3 Codex') + }) +})