Skip to content

Commit 53d8374

Browse files
committed
fix(catalog): preserve per-model GPT-5.6 effort ladders
1 parent c0426f6 commit 53d8374

2 files changed

Lines changed: 30 additions & 20 deletions

File tree

‎src/codex/catalog/metadata.ts‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import upstreamModelsSnapshot from "../data/upstream-models.json";
3434
import { filterSupportedNativeSlugs } from "./parsing";
3535
import type { RawEntry } from "./parsing";
3636
import { readCurrentCatalogOrCache, unique } from "./bundled";
37-
import { ensureGpt56ReasoningLevels, isGpt56NativeSlug } from "./effort";
3837

3938
export const NATIVE_OPENAI_MODELS = [
4039
"gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.3-codex-spark",
@@ -88,16 +87,9 @@ export function nativeReasoningEfforts(slug: string): string[] {
8887
? upstream!.supported_reasoning_levels as Array<{ effort?: string }>
8988
: [];
9089
if (levels.length > 0) {
91-
const efforts = levels.flatMap(l => typeof l.effort === "string" ? [l.effort] : []);
92-
// gpt-5.6 natives get max+ultra restored (ensureGpt56ReasoningLevels catalog path does
93-
// the same); older natives (gpt-5.5/5.4/5.4-mini/5.3-codex-spark) stop at xhigh per
94-
// upstream snapshot.
95-
if (isGpt56NativeSlug(slug)) {
96-
const set = new Set(efforts);
97-
for (const e of ["max", "ultra"]) set.add(e);
98-
return [...set];
99-
}
100-
return efforts;
90+
// Preserve the exact pinned per-model ladder. In particular, GPT-5.6 Sol and Terra
91+
// include ultra while Luna intentionally ends at max.
92+
return levels.flatMap(l => typeof l.effort === "string" ? [l.effort] : []);
10193
}
10294
// gpt-5.3-codex-spark is not in upstream snapshot — use the standard old-ladder default.
10395
return ["low", "medium", "high", "xhigh"];

‎tests/grok-models-effort-list.test.ts‎

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,33 @@ describe("raw /v1/models list reasoning-effort advertisement (Grok Build discove
5858
{ value: "high", label: "High Effort", default: true },
5959
{ value: "max", label: "Max Effort" },
6060
]);
61-
// Native rows advertise the upstream ladder and preserve the pinned upstream default
62-
// (gpt-5.6-sol => low), matching the Codex catalog path.
63-
const native = body.data.find(m => m.id === "gpt-5.6-sol");
64-
expect(native).toBeDefined();
65-
expect(native!.supports_reasoning_effort).toBe(true);
66-
expect(native!.reasoning_effort).toBe("low");
67-
expect((native!.reasoning_efforts as Array<{ value: string }>).map(option => option.value)).toEqual([
68-
"low", "medium", "high", "xhigh", "max", "ultra",
69-
]);
61+
// Native rows preserve the pinned per-model ladder and default. Sol and Terra include
62+
// ultra, while Luna intentionally ends at max, matching the canonical Codex catalog.
63+
const nativeExpectations = [
64+
{
65+
id: "gpt-5.6-sol",
66+
defaultEffort: "low",
67+
efforts: ["low", "medium", "high", "xhigh", "max", "ultra"],
68+
},
69+
{
70+
id: "gpt-5.6-terra",
71+
defaultEffort: "medium",
72+
efforts: ["low", "medium", "high", "xhigh", "max", "ultra"],
73+
},
74+
{
75+
id: "gpt-5.6-luna",
76+
defaultEffort: "medium",
77+
efforts: ["low", "medium", "high", "xhigh", "max"],
78+
},
79+
];
80+
for (const expected of nativeExpectations) {
81+
const native = body.data.find(m => m.id === expected.id);
82+
expect(native).toBeDefined();
83+
expect(native!.supports_reasoning_effort).toBe(true);
84+
expect(native!.reasoning_effort).toBe(expected.defaultEffort);
85+
expect((native!.reasoning_efforts as Array<{ value: string }>).map(option => option.value))
86+
.toEqual(expected.efforts);
87+
}
7088
} finally {
7189
await server.stop(true);
7290
}

0 commit comments

Comments
 (0)