Skip to content

Commit 926ca6c

Browse files
committed
feat(catalog): ship gpt-daybreak-blue-latest as a global native row
Owner decision. The slug is entitlement-gated upstream: it is absent from codex-rs's bundled catalog and reaches a client only through an authenticated /models response. Because opencodex injects model_catalog_json, codex-rs builds a StaticModelsManager whose refresh is a no-op, so an entitled account had no way to discover it on a clean install. Adding it to NATIVE_OPENAI_MODELS closes that gap. Capability is inherited from gpt-5.6-sol through the existing alias mechanism, so the row carries multi_agent_version v2. The slug now sits in BOTH NATIVE_OPENAI_MODELS and NATIVE_OPENAI_CAPABILITY_ALIAS_MODELS; the maps consuming their union are keyed by slug so it collapses to one entry, and row generation iterates NATIVE_OPENAI_MODELS alone, so exactly one bare row and one row per account selector are emitted. Tests assert that with toHaveLength(1) rather than exists, so a duplicate-row regression fails here. Accepted tradeoff, documented at the declaration: an UNENTITLED account also sees the row. Catalog sync still succeeds; selecting the model reaches the canonical OpenAI provider and the backend answers 400, which is relayed (a bare pooled route may first retry one alternate account on that exact body; a selector-qualified route is fixed and relays immediately). disabledModels hides the row but is not a runtime routing denial. Fixture updates follow from the reversal: suites that used this slug as a stand-in for an UNKNOWN observation-only native move to gpt-future-unlisted, and the management and Claude discovery surfaces now report the global bare identity.
1 parent df83829 commit 926ca6c

7 files changed

Lines changed: 114 additions & 29 deletions

‎src/codex/catalog/native-models.ts‎

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,19 @@ const NATIVE_OPENAI_CAPABILITY_SOURCES: Readonly<Record<string, string>> = Objec
1212
[NATIVE_DAYBREAK_BLUE_MODEL]: "gpt-5.6-sol",
1313
});
1414

15-
/** Account-scoped native ids that may inherit metadata but never enter the bare allowlist. */
15+
/**
16+
* Native ids whose capability metadata is inherited from another pinned native row.
17+
*
18+
* Membership here is about METADATA INHERITANCE only, and is independent of whether the
19+
* slug is also globally allowlisted in `NATIVE_OPENAI_MODELS`. `gpt-daybreak-blue-latest`
20+
* is now in BOTH: it inherits Sol's capability shape AND ships as a globally supported
21+
* native row (owner decision, devlog 260816_codexrs_multiagent_v2_and_history_perf/011).
22+
*
23+
* The maps that consume the union of these two lists (`PINNED_NATIVE_CAPABILITY_ENTRIES`,
24+
* `UPSTREAM_NATIVE_ENTRIES`) are keyed by slug, so an overlapping id collapses to one
25+
* entry. Catalog row generation iterates `NATIVE_OPENAI_MODELS` alone, so it still emits
26+
* exactly one bare row and one row per account selector.
27+
*/
1628
export const NATIVE_OPENAI_CAPABILITY_ALIAS_MODELS = Object.freeze(
1729
Object.keys(NATIVE_OPENAI_CAPABILITY_SOURCES),
1830
);
@@ -25,10 +37,28 @@ export function nativeOpenAiCapabilitySourceSlug(slug: string): string {
2537
return NATIVE_OPENAI_CAPABILITY_SOURCES[slug] ?? slug;
2638
}
2739

28-
/** Native OpenAI model ids that this release can route and restore with authoritative metadata. */
40+
/**
41+
* Native OpenAI model ids that this release can route and restore with authoritative metadata.
42+
*
43+
* `gpt-daybreak-blue-latest` is entitlement-gated upstream: it is absent from codex-rs's
44+
* bundled catalog and reaches a client only through an authenticated `/models` response.
45+
* It is listed here by explicit owner decision so the row exists without waiting for an
46+
* observation, because opencodex injects `model_catalog_json` and codex-rs therefore builds
47+
* a `StaticModelsManager` whose refresh is a no-op — an entitled account had no way to
48+
* discover it on a clean install.
49+
*
50+
* Accepted tradeoff: an UNENTITLED account also sees the row. Catalog sync still succeeds;
51+
* selecting the model reaches the canonical OpenAI provider and the backend answers 400
52+
* "model not supported for this account", which is relayed (a bare pooled route may first
53+
* retry one alternate account on that exact body; a selector-qualified route is fixed and
54+
* relays immediately). `disabledModels` hides the row but is NOT a runtime routing denial.
55+
*
56+
* Devlog: 260816_codexrs_multiagent_v2_and_history_perf/011 §4-bis.
57+
*/
2958
export const NATIVE_OPENAI_MODELS = [
3059
"gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.3-codex-spark",
3160
"gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna",
61+
NATIVE_DAYBREAK_BLUE_MODEL,
3262
];
3363

3464
export const SUPPORTED_NATIVE_OPENAI_SLUGS = new Set(NATIVE_OPENAI_MODELS);

‎tests/claude-models-discovery.test.ts‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ test("Codex discovery restores account rows for supported natives hidden on disk
336336
}
337337
});
338338

339-
test("Codex discovery preserves an observed account-only native id exactly", async () => {
339+
test("Codex discovery exposes the observed native as a selector row plus one global bare row", async () => {
340340
const config = configWithStaticModels();
341341
config.providers.openai = {
342342
adapter: "openai-responses",
@@ -378,7 +378,9 @@ test("Codex discovery preserves an observed account-only native id exactly", asy
378378
const plain = await fetch(new URL("/v1/models", server.url))
379379
.then(response => response.json()) as { data: Array<{ id: string }> };
380380
expect(plain.data).toContainEqual(expect.objectContaining({ id: "team/gpt-daybreak-blue-latest" }));
381-
expect(plain.data.some(model => model.id === "gpt-daybreak-blue-latest")).toBe(false);
381+
// Daybreak is globally allowlisted (owner decision, devlog 260816_.../011), so the bare
382+
// id is now discoverable too, exactly once.
383+
expect(plain.data.filter(model => model.id === "gpt-daybreak-blue-latest")).toHaveLength(1);
382384

383385
const managementUrl = new URL("http://localhost/api/models");
384386
const managementResponse = await handleManagementAPI(
@@ -387,11 +389,15 @@ test("Codex discovery preserves an observed account-only native id exactly", asy
387389
config,
388390
);
389391
const management = await managementResponse!.json() as Array<{ id: string; native?: boolean }>;
392+
// Once Daybreak is globally allowlisted the management surface reports it under its
393+
// GLOBAL bare identity rather than as an account-qualified discovery row
394+
// (model-rows.ts:59 / metadata.ts:243). Exactly one row, and no selector duplicate.
390395
expect(management).toContainEqual(expect.objectContaining({
391-
id: "team/gpt-daybreak-blue-latest",
396+
id: "gpt-daybreak-blue-latest",
392397
native: true,
393398
}));
394-
expect(management.some(model => model.id === "gpt-daybreak-blue-latest")).toBe(false);
399+
expect(management.filter(model => model.id === "gpt-daybreak-blue-latest")).toHaveLength(1);
400+
expect(management.some(model => model.id === "team/gpt-daybreak-blue-latest")).toBe(false);
395401

396402
const catalog = await fetch(new URL("/v1/models?client_version=1.0.0", server.url))
397403
.then(response => response.json()) as { models: Array<{ slug: string; visibility?: string }> };
@@ -403,8 +409,13 @@ test("Codex discovery preserves an observed account-only native id exactly", asy
403409
const anthropic = await fetch(new URL("/v1/models?flavor=anthropic&ids=cli", server.url), {
404410
headers: { "anthropic-version": "2023-06-01" },
405411
}).then(response => response.json()) as { data: Array<{ id: string }> };
406-
expect(anthropic.data.some(model => model.id === claudeCodeNativeAlias("team/gpt-daybreak-blue-latest"))).toBe(true);
412+
// Claude discovery advertises only rows visible in the Codex catalog. The global bare
413+
// Daybreak row is synthesized as visibility "hide" (asserted above), and the
414+
// account-qualified projection is no longer produced now that the slug is globally
415+
// allowlisted, so neither identity reaches the Anthropic surface. Verified empirically:
416+
// the filtered id list contained gpt-5.5 only.
407417
expect(anthropic.data.some(model => model.id === claudeCodeNativeAlias("gpt-daybreak-blue-latest"))).toBe(false);
418+
expect(anthropic.data.some(model => model.id === claudeCodeNativeAlias("team/gpt-daybreak-blue-latest"))).toBe(false);
408419
} finally {
409420
await server.stop(true);
410421
}

‎tests/codex-catalog-sync-hardening.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,9 @@ describe("Codex catalog sync hardening", () => {
427427
use_responses_lite: true,
428428
supports_parallel_tool_calls: true,
429429
});
430-
expect(rows.some(row => row.slug === "gpt-daybreak-blue-latest")).toBe(false);
430+
// Daybreak is globally allowlisted now (owner decision, devlog 260816_.../011),
431+
// so the bare row IS expected — exactly once — alongside the account-qualified row.
432+
expect(rows.filter(row => row.slug === "gpt-daybreak-blue-latest")).toHaveLength(1);
431433
});
432434

433435
test("explicit Codex-forward Daybreak survives sync with Sol metadata while account picker is off", () => {
@@ -477,8 +479,11 @@ describe("Codex catalog sync hardening", () => {
477479
opencodex_catalog_kind: "custom-model-v1",
478480
});
479481
expect(daybreak?.base_instructions).toContain("powered by the gpt-daybreak-blue-latest");
480-
expect(rows.some(row => row.slug === "gpt-daybreak-blue-latest")).toBe(false);
482+
// The global native row exists (owner decision); the explicit Codex-forward custom row
483+
// above is a separate identity and must not collapse into it.
484+
expect(rows.filter(row => row.slug === "gpt-daybreak-blue-latest")).toHaveLength(1);
481485
expect(rows.some(row => row.slug === "main/gpt-daybreak-blue-latest")).toBe(false);
486+
// The separately billed API-key alias must still never reach the Codex surface.
482487
expect(rows.some(row => row.slug === "openai-apikey/daybreak-blue-latest")).toBe(false);
483488
});
484489

‎tests/codex-catalog.test.ts‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,7 +2793,11 @@ describe("Codex catalog routed normalization", () => {
27932793
expect(nativeOpenAiContextWindow("gpt-5.4", 272_000)).toBe(272_000);
27942794
});
27952795

2796-
test("account-scoped Daybreak Blue inherits Sol capabilities without expanding the bare allowlist", () => {
2796+
// Owner decision (devlog 260816_.../011 §4-bis): Daybreak Blue is now a GLOBALLY
2797+
// allowlisted native, so a bare row IS expected. It still inherits Sol's capability
2798+
// shape, and the overlap between NATIVE_OPENAI_MODELS and
2799+
// NATIVE_OPENAI_CAPABILITY_ALIAS_MODELS must not duplicate any row.
2800+
test("Daybreak Blue inherits Sol capabilities and ships one bare row plus one row per selector", () => {
27972801
expect(NATIVE_DAYBREAK_BLUE_MODEL).toBe("gpt-daybreak-blue-latest");
27982802
expect(nativeOpenAiCapabilitySourceSlug(NATIVE_DAYBREAK_BLUE_MODEL)).toBe("gpt-5.6-sol");
27992803
expect(nativeOpenAiContextWindow(NATIVE_DAYBREAK_BLUE_MODEL)).toBe(372_000);
@@ -2821,6 +2825,7 @@ describe("Codex catalog routed normalization", () => {
28212825
expect((source?.model_messages as { instructions_template?: string })?.instructions_template)
28222826
.toContain("powered by the gpt-daybreak-blue-latest");
28232827

2828+
// NATIVE_OPENAI_MODELS already contains the slug; passing it again would double it.
28242829
const projected = buildCatalogEntries(
28252830
nativeTemplate(),
28262831
NATIVE_OPENAI_MODELS,
@@ -2833,8 +2838,8 @@ describe("Codex catalog routed normalization", () => {
28332838
new Set(),
28342839
new Set(),
28352840
undefined,
2836-
[...NATIVE_OPENAI_MODELS, NATIVE_DAYBREAK_BLUE_MODEL],
2837-
new Map([["main", [...NATIVE_OPENAI_MODELS, NATIVE_DAYBREAK_BLUE_MODEL]]]),
2841+
[...NATIVE_OPENAI_MODELS],
2842+
new Map([["main", [...NATIVE_OPENAI_MODELS]]]),
28382843
);
28392844
const daybreak = projected.find(entry => entry.slug === `main/${NATIVE_DAYBREAK_BLUE_MODEL}`);
28402845
const sol = projected.find(entry => entry.slug === "gpt-5.6-sol");
@@ -2849,7 +2854,11 @@ describe("Codex catalog routed normalization", () => {
28492854
supports_parallel_tool_calls: sol?.supports_parallel_tool_calls,
28502855
input_modalities: sol?.input_modalities,
28512856
});
2852-
expect(projected.some(entry => entry.slug === NATIVE_DAYBREAK_BLUE_MODEL)).toBe(false);
2857+
// The bare row now exists (owner decision) and appears exactly once, proving the
2858+
// two-list overlap does not duplicate it.
2859+
expect(projected.filter(entry => entry.slug === NATIVE_DAYBREAK_BLUE_MODEL)).toHaveLength(1);
2860+
expect(projected.filter(entry => entry.slug === `main/${NATIVE_DAYBREAK_BLUE_MODEL}`)).toHaveLength(1);
2861+
// The separately billed API-key alias must still never appear on the Codex surface.
28532862
expect(projected.some(entry => entry.slug === "daybreak-blue-latest")).toBe(false);
28542863
});
28552864

‎tests/codex-convergence-account-selectors.test.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ test("convergence drops unsupported bare native rows and never qualifies them",
355355
))).toBe(true);
356356
});
357357

358-
test("convergence preserves an observed account-only native id without creating a bare row", async () => {
358+
test("convergence projects the observed Daybreak row onto its selector and one bare row", async () => {
359359
writeCatalog([nativeEntry()]);
360360
writeFileSync(join(codexHome, "models_cache.json"), JSON.stringify({
361361
models: [{
@@ -388,8 +388,12 @@ test("convergence preserves an observed account-only native id without creating
388388
});
389389
expect((daybreak?.supported_reasoning_levels as Array<{ effort: string }>).map(level => level.effort))
390390
.toEqual(["low", "medium", "high", "xhigh", "max", "ultra"]);
391-
expect(models.some(entry => entry.slug === "team/gpt-daybreak-blue-latest")).toBe(false);
392-
expect(models.some(entry => entry.slug === "gpt-daybreak-blue-latest")).toBe(false);
391+
// Daybreak is globally allowlisted (owner decision, devlog 260816_.../011). A global
392+
// native is seeded onto EVERY visible selector, not only the one that observed it, and the
393+
// bare row now exists. Each must appear exactly once despite the observation also present.
394+
expect(models.filter(entry => entry.slug === "team/gpt-daybreak-blue-latest")).toHaveLength(1);
395+
expect(models.filter(entry => entry.slug === "desktop/gpt-daybreak-blue-latest")).toHaveLength(1);
396+
expect(models.filter(entry => entry.slug === "gpt-daybreak-blue-latest")).toHaveLength(1);
393397
});
394398

395399
test("convergence preserves unrelated foreign rows alongside fresh configured provider rows", async () => {

‎tests/codex-models-cache-invalidate.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ describe("invalidateCodexModelsCache write gate (#476 / #518)", () => {
6060
}, null, 2) + "\n");
6161
writeFileSync(join(codexHome, "models_cache.json"), JSON.stringify({
6262
models: [{
63-
slug: "gpt-daybreak-blue-latest",
63+
// gpt-daybreak-blue-latest is a KNOWN global native now (devlog 260816_.../011),
64+
// so it can no longer stand in for an unknown observed id.
65+
slug: "gpt-future-unlisted",
6466
visibility: "list",
6567
supported_in_api: true,
6668
shell_type: "shell_command",
@@ -75,7 +77,7 @@ describe("invalidateCodexModelsCache write gate (#476 / #518)", () => {
7577
const cache = JSON.parse(readFileSync(join(codexHome, "models_cache.json"), "utf8")) as {
7678
models: Array<Record<string, unknown>>;
7779
};
78-
expect(cache.models.find(model => model.slug === "gpt-daybreak-blue-latest")).toMatchObject({
80+
expect(cache.models.find(model => model.slug === "gpt-future-unlisted")).toMatchObject({
7981
visibility: "hide",
8082
opencodex_account_observed_native: true,
8183
});

‎tests/native-model-toggle.test.ts‎

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,18 @@ describe("native GPT model toggles (bare slugs in disabledModels)", () => {
142142
expect(entries.every(entry => Number.isInteger(entry.priority))).toBe(true);
143143
});
144144

145+
// gpt-daybreak-blue-latest is now a GLOBALLY allowlisted native (owner decision, devlog
146+
// 260816_.../011), so it is no longer an "unknown observed id" and cannot stand in for one
147+
// here. gpt-future-unlisted plays that role instead; the invariant under test is unchanged.
145148
test("observed account-only native ids stay qualified and do not expand the bare set", () => {
146149
const observedEntries = [
147-
{ ...nativeTemplate(), slug: "gpt-daybreak-blue-latest", visibility: "list", supported_in_api: true },
148-
{ ...nativeTemplate(), slug: "gpt-hidden-daybreak", visibility: "hide", supported_in_api: true },
150+
{ ...nativeTemplate(), slug: "gpt-future-unlisted", visibility: "list", supported_in_api: true },
151+
{ ...nativeTemplate(), slug: "gpt-hidden-future", visibility: "hide", supported_in_api: true },
149152
{ ...nativeTemplate(), slug: "gpt-not-an-api-model", visibility: "list", supported_in_api: false },
150-
{ ...nativeTemplate(), slug: "provider/gpt-daybreak-blue-latest", visibility: "list", supported_in_api: true },
153+
{ ...nativeTemplate(), slug: "provider/gpt-future-unlisted", visibility: "list", supported_in_api: true },
151154
];
152-
expect(accountBoundNativeOpenAiSlugs(observedEntries)).toContain("gpt-daybreak-blue-latest");
153-
expect(accountBoundNativeOpenAiSlugs(observedEntries)).not.toContain("gpt-hidden-daybreak");
155+
expect(accountBoundNativeOpenAiSlugs(observedEntries)).toContain("gpt-future-unlisted");
156+
expect(accountBoundNativeOpenAiSlugs(observedEntries)).not.toContain("gpt-hidden-future");
154157
expect(accountBoundNativeOpenAiSlugs(observedEntries)).not.toContain("gpt-not-an-api-model");
155158

156159
const entries = buildCatalogEntries(
@@ -167,25 +170,46 @@ describe("native GPT model toggles (bare slugs in disabledModels)", () => {
167170
undefined,
168171
accountBoundNativeOpenAiSlugs(observedEntries),
169172
);
170-
expect(entries.find(entry => entry.slug === "gpt-daybreak-blue-latest")).toBeUndefined();
171-
expect(entries.find(entry => entry.slug === "team/gpt-daybreak-blue-latest")).toMatchObject({
173+
expect(entries.find(entry => entry.slug === "gpt-future-unlisted")).toBeUndefined();
174+
expect(entries.find(entry => entry.slug === "team/gpt-future-unlisted")).toMatchObject({
172175
opencodex_catalog_kind: CODEX_ACCOUNT_BOUND_CATALOG_KIND,
173176
visibility: "list",
174177
});
175178

176179
expect(observedAccountBoundNativeEntries([{
177180
...nativeTemplate(),
178-
slug: "gpt-daybreak-blue-latest",
181+
slug: "gpt-future-unlisted",
179182
visibility: "hide",
180183
supported_in_api: true,
181184
opencodex_account_observed_native: true,
182185
}])).toHaveLength(1);
183-
expect(observedAccountBoundNativeOpenAiSlugs(observedEntries)).toEqual(["gpt-daybreak-blue-latest"]);
186+
expect(observedAccountBoundNativeOpenAiSlugs(observedEntries)).toEqual(["gpt-future-unlisted"]);
187+
});
188+
189+
test("gpt-daybreak-blue-latest ships as a global native row without an observation", () => {
190+
const entries = buildCatalogEntries(
191+
nativeTemplate(),
192+
[...NATIVE_OPENAI_MODELS],
193+
[],
194+
[],
195+
false,
196+
"default",
197+
new Set(),
198+
[],
199+
new Set(),
200+
new Set(),
201+
);
202+
const bare = entries.filter(entry => entry.slug === "gpt-daybreak-blue-latest");
203+
// Exactly one row: the slug sits in BOTH NATIVE_OPENAI_MODELS and
204+
// NATIVE_OPENAI_CAPABILITY_ALIAS_MODELS, and that overlap must not duplicate it.
205+
expect(bare).toHaveLength(1);
206+
// Capability is inherited from gpt-5.6-sol, so it is a recursive-capable v2 delegate.
207+
expect(bare[0]?.multi_agent_version).toBe("v2");
184208
});
185209

186210
test("a minimal hand-edited cache row is ignored", () => {
187-
const handEdited = [{ slug: "gpt-daybreak-blue-latest", visibility: "list", supported_in_api: true }];
188-
expect(accountBoundNativeOpenAiSlugs(handEdited)).not.toContain("gpt-daybreak-blue-latest");
211+
const handEdited = [{ slug: "gpt-future-unlisted", visibility: "list", supported_in_api: true }];
212+
expect(accountBoundNativeOpenAiSlugs(handEdited)).not.toContain("gpt-future-unlisted");
189213
expect(observedAccountBoundNativeEntries(handEdited)).toEqual([]);
190214
});
191215

0 commit comments

Comments
 (0)