From 1e9627f92dd71fa3e7a65cf7e8e5a3a1fb3067e8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 21 Apr 2026 16:22:45 +0100 Subject: [PATCH] test: generalize codex rejected-permission fallback --- src/gateway/gateway-codex-harness.live-helpers.test.ts | 1 + src/gateway/gateway-codex-harness.live-helpers.ts | 9 ++++++--- 2 files changed, 7 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 6d3b1456ec5..f5b5ef1d305 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.test.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.test.ts @@ -46,6 +46,7 @@ describe("gateway codex harness live helpers", () => { 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.", + "I couldn’t list them because the local `codex models` command requires host permissions here, and that escalation was rejected.", ]; for (const text of texts) { diff --git a/src/gateway/gateway-codex-harness.live-helpers.ts b/src/gateway/gateway-codex-harness.live-helpers.ts index 96db6c4cfc1..b2b49ee1624 100644 --- a/src/gateway/gateway-codex-harness.live-helpers.ts +++ b/src/gateway/gateway-codex-harness.live-helpers.ts @@ -57,9 +57,12 @@ export function isExpectedCodexModelsCommandText(text: string): boolean { normalized.includes("fails to start") || normalized.includes("repo-local fallback") || 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("rejected") && + (normalized.includes("sandbox") || + normalized.includes("permission") || + normalized.includes("permissions") || + normalized.includes("escalation") || + normalized.includes("elevated execution"))) || normalized.includes("interactive in this environment") || normalized.includes("sandboxed session") || normalized.includes("required user namespace") ||