From 13d4a7bad39ecd54f0299956a9ce6934e97bc5a9 Mon Sep 17 00:00:00 2001 From: luvs01 <27862058+luvs01@users.noreply.github.com> Date: Fri, 18 Sep 2026 14:47:37 +0900 Subject: [PATCH] fix(catalog): keep live pins when the supplied baseline omits the slug --- src/codex/catalog/parsing.ts | 4 +++- tests/codex-integration/codex-v2-gate.test.ts | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/codex/catalog/parsing.ts b/src/codex/catalog/parsing.ts index 78a5ab93e6..5634caa00b 100644 --- a/src/codex/catalog/parsing.ts +++ b/src/codex/catalog/parsing.ts @@ -762,7 +762,9 @@ export function applyMultiAgentMode( ? nativeMultiAgentVersion(codexForwardCapabilityAlias) : hasNativeDefault ? options.nativeDefaults?.get(nativeLookupSlug) - : UPSTREAM_NATIVE_ENTRIES.get(nativeLookupSlug)?.multi_agent_version; + : options.nativeDefaults === undefined + ? UPSTREAM_NATIVE_ENTRIES.get(nativeLookupSlug)?.multi_agent_version + : undefined; if (typeof upstreamPin === "string") { entry.multi_agent_version = upstreamPin; } else if (options.nativeDefaults !== undefined diff --git a/tests/codex-integration/codex-v2-gate.test.ts b/tests/codex-integration/codex-v2-gate.test.ts index 415df787d8..c5de8861a5 100644 --- a/tests/codex-integration/codex-v2-gate.test.ts +++ b/tests/codex-integration/codex-v2-gate.test.ts @@ -2089,5 +2089,22 @@ describe("3-state multi-agent mode", () => { expect(defaults.has("gpt-5.5")).toBe(true); expect(defaults.get("gpt-5.5")).toBeNull(); }); + + test("mode default keeps a live pin the supplied baseline does not mention", () => { + // A supplied baseline is authoritative only for the slugs it contains. When + // the backup omits the bundled "gpt-5.6-sol" row, the live catalog's preserved + // "v1" pin must survive: falling back to the bundled "v2" snapshot here would + // rewrite a pin the baseline never spoke about. The preservation branch below + // can only run when the bundled lookup yields no pin for this row. + const liveSol = { ...template(), slug: "gpt-5.6-sol", display_name: "GPT-5.6 Sol", multi_agent_version: "v1" }; + const merged = mergeCatalogEntriesForSync( + [liveSol as never], [], new Map(), [], false, + new Set(), null, new Set(), new Set(), "default", + new Set(), false, true, [], + new Set(), new Set(), undefined, false, + new Map([["gpt-5.5", "v1"]]), + ); + expect(merged.find(e => e.slug === "gpt-5.6-sol")?.multi_agent_version).toBe("v1"); + }); }); import { ManagementRequest as Request } from "../helpers/management-auth";