From 3e12accb4bef36d2d30da3691e4b285956b9aef2 Mon Sep 17 00:00:00 2001 From: Matteo Dante Date: Sat, 31 Oct 2026 14:01:59 +0100 Subject: [PATCH 1/2] fix(codex): prevent catalog agents in ChatGPT sharing --- apps/server/src/provider/CodexManagedRuntime.test.ts | 1 + apps/server/src/provider/CodexManagedRuntime.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/apps/server/src/provider/CodexManagedRuntime.test.ts b/apps/server/src/provider/CodexManagedRuntime.test.ts index 8f8408bdaee1f..d11103c561b8b 100644 --- a/apps/server/src/provider/CodexManagedRuntime.test.ts +++ b/apps/server/src/provider/CodexManagedRuntime.test.ts @@ -197,6 +197,7 @@ it.live.each( assert.include(args, "features.api_key_model_discovery=true"); assert.include(args, "features.multi_agent=false"); assert.include(args, "features.multi_agent_v2=false"); + assert.include(args, "agents.enabled=false"); assert.notInclude(effective.config.launchArgs, "model_catalog_json"); assert.notInclude(effective.config.launchArgs, "x-openai-chatpass-test"); assert.include(provider, "supports_websockets=false"); diff --git a/apps/server/src/provider/CodexManagedRuntime.ts b/apps/server/src/provider/CodexManagedRuntime.ts index 3704c919c2791..b2e663e837d8b 100644 --- a/apps/server/src/provider/CodexManagedRuntime.ts +++ b/apps/server/src/provider/CodexManagedRuntime.ts @@ -27,6 +27,8 @@ const managedCodexLaunchArgs = (command: string, args: ReadonlyArray) => "features.api_key_model_discovery=true", "features.multi_agent=false", "features.multi_agent_v2=false", + // The model catalog can enable native agents independently of the feature flags. + "agents.enabled=false", ] .map((value) => `-c ${JSON.stringify(value)}`) .join(" "); From c9b0ece1a9ad3638b2f8f7f5ea67d812905ad834 Mon Sep 17 00:00:00 2001 From: Matteo Dante Date: Mon, 2 Nov 2026 12:17:31 +0100 Subject: [PATCH 2/2] test(codex): use native paths in managed runtime coverage Build the overlay-home expectation with the injected Path service. A POSIX-only substring stopped both additional-account cases before the catalog-agent assertions on Windows. The existing four-case matrix now passes and catches a missing agents.enabled override in every case. --- apps/server/src/provider/CodexManagedRuntime.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/src/provider/CodexManagedRuntime.test.ts b/apps/server/src/provider/CodexManagedRuntime.test.ts index d11103c561b8b..b5322785a6b63 100644 --- a/apps/server/src/provider/CodexManagedRuntime.test.ts +++ b/apps/server/src/provider/CodexManagedRuntime.test.ts @@ -121,7 +121,7 @@ it.live.each( assert.equal(runtime.homeLayout.mode, "direct"); } else { assert.include(effective.config.homePath, instanceId); - assert.include(effective.config.homePath, "userdata/providers/codex"); + assert.include(effective.config.homePath, path.join("userdata", "providers", "codex")); assert.equal(runtime.homeLayout.mode, "authOverlay"); assert.equal( yield* fs.readLink(path.join(effective.config.homePath, "sessions")),