fix(core/exec): treat only 126 as likely sandbox denial; avoid false escalations for 1/2/127

- Update is_likely_sandbox_denied heuristic
- Prevent spurious approvals and post-approval hangs on common failures

Closes #51
This commit is contained in:
James Peter
2025-09-08 09:56:40 +10:00
parent a3b5c18aea
commit e4e5fb019f
+4 -7
View File
@@ -180,14 +180,11 @@ fn is_likely_sandbox_denied(sandbox_type: SandboxType, exit_code: i32) -> bool {
return false; return false;
} }
// Quick rejects: well-known non-sandbox shell exit codes match exit_code {
// 127: command not found, 2: misuse of shell builtins 126 => true, // found but not executable (likely permission denial)
if exit_code == 127 { 1 | 2 | 127 => false, // common non-sandbox failures
return false; _ => false,
} }
// For all other cases, we assume the sandbox is the cause
true
} }
#[derive(Debug)] #[derive(Debug)]