From ceb88071abb5d860fa0d24b17fd37e3b97062697 Mon Sep 17 00:00:00 2001 From: luvs01 <27862058+luvs01@users.noreply.github.com> Date: Sun, 20 Sep 2026 17:20:29 +0900 Subject: [PATCH] fix(catalog): accept parser sentinels none/minimal in effort compatibility --- src/codex/catalog/effort.ts | 10 ++++++++-- tests/clients/client-catalog-compatibility.test.ts | 13 +++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/codex/catalog/effort.ts b/src/codex/catalog/effort.ts index 4206983183b..9e1e9e142ef 100644 --- a/src/codex/catalog/effort.ts +++ b/src/codex/catalog/effort.ts @@ -413,6 +413,10 @@ export interface CatalogEffortCompatibility { readonly affectedModels: readonly string[]; } +// These parser-valid sentinels do not appear in native model ladders, so absence from an +// observed bundled catalog is not evidence that the selected Codex runtime rejects them. +const CODEX_PARSER_SENTINEL_EFFORTS = new Set(["none", "minimal"]); + /** * Report which reasoning efforts in a catalog the local Codex runtime would reject, without * changing anything. @@ -432,9 +436,11 @@ export function catalogEffortCompatibility( const unsupported = new Set(); const affected: string[] = []; for (const entry of models) { - const rejected = catalogEntryEfforts(entry).filter(effort => !supported.has(effort)); + const accepts = (effort: string): boolean => supported.has(effort) + || CODEX_PARSER_SENTINEL_EFFORTS.has(effort); + const rejected = catalogEntryEfforts(entry).filter(effort => !accepts(effort)); const fallback = typeof entry.default_reasoning_level === "string" - && !supported.has(entry.default_reasoning_level) + && !accepts(entry.default_reasoning_level) ? [entry.default_reasoning_level] : []; if (rejected.length === 0 && fallback.length === 0) continue; diff --git a/tests/clients/client-catalog-compatibility.test.ts b/tests/clients/client-catalog-compatibility.test.ts index 454ff14c67c..b27f764af49 100644 --- a/tests/clients/client-catalog-compatibility.test.ts +++ b/tests/clients/client-catalog-compatibility.test.ts @@ -67,6 +67,19 @@ describe("#4207 catalog effort compatibility", () => { }); }); + test("parser sentinels are accepted even when absent from observed native ladders", () => { + // Native bundled rows do not advertise these values, but the Codex catalog parser accepts + // both. The observed rows therefore cannot be treated as an exhaustive parser enum. + const observedNativeLadder = new Set(["low", "medium", "high", "xhigh"]); + const models = JSON.parse(catalogBody(["none", "minimal"], "provider/model", "minimal")).models; + + expect(catalogEffortCompatibility(models, observedNativeLadder)).toEqual({ + compatible: true, + unsupportedEfforts: [], + affectedModels: [], + }); + }); + test("an unobservable runtime ladder is not evidence of incompatibility", () => { const models = JSON.parse(catalogBody(["low", "max"])).models; expect(catalogEffortCompatibility(models, null).compatible).toBe(true);