test: generalize codex rejected-permission fallback

This commit is contained in:
Peter Steinberger
2026-04-21 16:22:45 +01:00
parent 26b359bebd
commit 1e9627f92d
2 changed files with 7 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ describe("gateway codex harness live helpers", () => {
const texts = [
"I couldnt list them because `codex models` requires running outside the sandbox here, and that approval was rejected.",
"I couldnt list them because the local `codex models` command requires elevated execution in this environment, and that request was rejected.",
"I couldnt list them because the local `codex models` command requires host permissions here, and that escalation was rejected.",
];
for (const text of texts) {

View File

@@ -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") ||