From 83fd3180d2dce0792b6c36c0d0ff136e5085e6c8 Mon Sep 17 00:00:00 2001 From: Minxi Hou Date: Wed, 7 Oct 2026 02:15:36 -0400 Subject: [PATCH] fix(codex): honor the ultra alias set for parenthesized suffixes Pre-existing: the parenthesized form `model(ultra)` was validated against CODEX_MAX_ALIAS_MODELS regardless of the captured effort, so a max-only model like gpt-6-luna accepted `(ultra)` while the hyphenated `gpt-6-luna-ultra` was correctly rejected. Select the alias set by the captured effort value for both syntaxes. Signed-off-by: Minxi Hou --- open-sse/executors/codex/reasoningSuffix.ts | 7 ++----- tests/unit/codex-reasoning-suffix.test.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/open-sse/executors/codex/reasoningSuffix.ts b/open-sse/executors/codex/reasoningSuffix.ts index 627f2a339fb0..2347ee11f130 100644 --- a/open-sse/executors/codex/reasoningSuffix.ts +++ b/open-sse/executors/codex/reasoningSuffix.ts @@ -39,11 +39,8 @@ export function splitCodexReasoningSuffix(model: unknown): { if (maxTierMatch) { const [, baseModel, hyphenEffort, parenthesizedEffort] = maxTierMatch; const effort = hyphenEffort ?? parenthesizedEffort; - const supportedModels = parenthesizedEffort - ? CODEX_MAX_ALIAS_MODELS - : effort === "ultra" - ? CODEX_ULTRA_ALIAS_MODELS - : CODEX_MAX_ALIAS_MODELS; + const supportedModels = + effort === "ultra" ? CODEX_ULTRA_ALIAS_MODELS : CODEX_MAX_ALIAS_MODELS; if (supportedModels.has(baseModel)) { return { baseModel, effort: effort as CodexEffortLevel }; } diff --git a/tests/unit/codex-reasoning-suffix.test.ts b/tests/unit/codex-reasoning-suffix.test.ts index 5ade599beae5..341511659d48 100644 --- a/tests/unit/codex-reasoning-suffix.test.ts +++ b/tests/unit/codex-reasoning-suffix.test.ts @@ -23,3 +23,19 @@ test("Codex Astra supports max and ultra aliases without widening other models", effort: null, }); }); + +test("parenthesized ultra honors the ultra alias set, not the max set", () => { + assert.deepEqual(splitCodexReasoningSuffix("gpt-6-luna(ultra)"), { + baseModel: "gpt-6-luna(ultra)", + effort: null, + }); + assert.deepEqual(splitCodexReasoningSuffix("gpt-6-luna-ultra"), { + baseModel: "gpt-6-luna-ultra", + effort: null, + }); + assert.deepEqual(splitCodexReasoningSuffix("gpt-6-luna(max)"), { + baseModel: "gpt-6-luna", + effort: "max", + }); +}); +