From f9925421320e2e7d257d7bd39a42a0a78468b647 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 21 Apr 2026 16:17:50 +0100 Subject: [PATCH] test: accept codex elevated execution fallback (cherry picked from commit 26b359bebd14bd8248b66a9f38ce3298eb97dfe6) --- src/gateway/gateway-codex-harness.live-helpers.test.ts | 10 +++++++--- src/gateway/gateway-codex-harness.live-helpers.ts | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gateway/gateway-codex-harness.live-helpers.test.ts b/src/gateway/gateway-codex-harness.live-helpers.test.ts index a2c3c42895d..6d3b1456ec5 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.test.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.test.ts @@ -43,10 +43,14 @@ describe("gateway codex harness live helpers", () => { }); it("accepts sandbox escalation rejection for codex models", () => { - const text = - "I couldn’t list them because `codex models` requires running outside the sandbox here, and that approval was rejected."; + const texts = [ + "I couldn’t list them because `codex models` requires running outside the sandbox here, and that approval was rejected.", + "I couldn’t list them because the local `codex models` command requires elevated execution in this environment, and that request was rejected.", + ]; - expect(isExpectedCodexModelsCommandText(text)).toBe(true); + for (const text of texts) { + expect(isExpectedCodexModelsCommandText(text)).toBe(true); + } }); it("accepts the interactive TUI current-model summary", () => { diff --git a/src/gateway/gateway-codex-harness.live-helpers.ts b/src/gateway/gateway-codex-harness.live-helpers.ts index c437c031990..96db6c4cfc1 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.ts @@ -59,6 +59,7 @@ export function isExpectedCodexModelsCommandText(text: string): boolean { normalized.includes("sandbox blocks") || (normalized.includes("outside the sandbox") && normalized.includes("approval was rejected")) || + (normalized.includes("elevated execution") && normalized.includes("request was rejected")) || normalized.includes("interactive in this environment") || normalized.includes("sandboxed session") || normalized.includes("required user namespace") ||