diff --git a/src/gateway/gateway-codex-harness.live-helpers.test.ts b/src/gateway/gateway-codex-harness.live-helpers.test.ts index c1c5410342f..283d7c5a28c 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.test.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.test.ts @@ -123,6 +123,23 @@ describe("gateway codex harness live helpers", () => { expect(isExpectedCodexModelsCommandText(text)).toBe(true); }); + it("accepts the current Codex agent model list from the live harness", () => { + const text = [ + "Available Codex agent models:", + "", + "- `dev`: `openai/gpt-5.5`", + " - Runtime: `codex`", + " - Configured: `false`", + "", + "No other agent models are currently exposed for this session.", + ].join("\n"); + + expect( + EXPECTED_CODEX_MODELS_COMMAND_TEXT.some((expectedText) => text.includes(expectedText)), + ).toBe(true); + expect(isExpectedCodexModelsCommandText(text)).toBe(true); + }); + it("accepts sandbox namespace failures with current-session model fallback", () => { const text = [ "I can’t enumerate `/codex models` from this sandbox because the local `codex` CLI fails to start here with a user-namespace restriction (`bwrap: No permissions to create a new namespace`).", diff --git a/src/gateway/gateway-codex-harness.live-helpers.ts b/src/gateway/gateway-codex-harness.live-helpers.ts index 4498c482cf4..7cd09a17ec3 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.ts @@ -1,6 +1,7 @@ export const EXPECTED_CODEX_MODELS_COMMAND_TEXT = [ "Codex models:", "Available Codex models", + "Available Codex agent models", "Available models:", "Available models, local cache:", "Available agent target:", @@ -184,6 +185,7 @@ export function isExpectedCodexModelsCommandText(text: string): boolean { const mentionsVisibleOptions = normalized.includes("visible options in this session:") || normalized.includes("visible options:") || + normalized.includes("available codex agent models:") || normalized.includes("available model overrides listed in this session:") || normalized.includes("available model overrides shown in this session:") || normalized.includes("available here:") || @@ -204,6 +206,9 @@ export function isExpectedCodexModelsCommandText(text: string): boolean { const isAgentIdModelSummary = normalized.includes("available agent ids in this session:") && (text.includes("`openai/") || text.includes("`codex/")); + const isCodexAgentModelSummary = + normalized.includes("available codex agent models:") && + (text.includes("`openai/") || text.includes("`codex/")); const isAvailableHereModelSummary = normalized.includes("available here:") && normalized.includes("current session model") && @@ -219,6 +224,7 @@ export function isExpectedCodexModelsCommandText(text: string): boolean { isSessionConfigFallback || isInteractiveSelectionSummary || isAgentIdModelSummary || + isCodexAgentModelSummary || isAvailableHereModelSummary || isInteractiveTuiSummary );