Skip to content

Overeager assumption of sandbox error #4859

Closed

Description

@corrylc

What version of Codex is running?

codex-cli 0.45.0

Which model were you using?

gpt-5-codex high

What platform is your computer?

Darwin 25.0.0 arm64 arm

What steps can reproduce the bug?

Ask codex to "run bash -c false"

What is the expected behavior?

Command is interpreted as "failing" (i.e. returns an error code) but isn't attributed to the sandbox.

What do you see instead?

• Ran bash -c false
  └ failed in sandbox:

Additional information

This is a reduction of the more complicated case I see, where some testing triggers this behavior. I tried to come up with the most basic test case that plainly can't be caused by the sandbox/seatbelt.

Activity

  1. added
    bug
    on Oct 7, 2025
  2. dipsy commented on Oct 7, 2025

    @dipsy

    same bug in codex-cli 0.45.0 (not in 0.44)

  3. corrylc commented on Oct 7, 2025

    @corrylc
    Author

    For now, I am using a small patch to nullify this issue, since it is almost never a sandbox issue. It seems odd for the codebase to so aggressively assume it is always a sandbox issue, when usually it... isn't?

    I am not enough of a rust programmer to trace the intended path here and fix the issue more properly, but this does work as a very rough workaround.

    diff --git a/codex-rs/core/src/exec.rs b/codex-rs/core/src/exec.rs
    index d84bbc9fc..7d2b7d1cc 100644
    --- a/codex-rs/core/src/exec.rs
    +++ b/codex-rs/core/src/exec.rs
    @@ -208,8 +208,7 @@ fn is_likely_sandbox_denied(sandbox_type: SandboxType, exit_code: i32) -> bool {
             return false;
         }
     
    -    // For all other cases, we assume the sandbox is the cause
    -    true
    +    false
     }
  4. corrylc commented on Oct 9, 2025

    @corrylc
    Author

    Looks like #4874 is resolves, at least in part, this issue. Will test a bit more, but it covers my basic test above 🎉

  5. corrylc commented on Oct 9, 2025

    @corrylc
    Author

    Closing, as I don't see any issues following the fix PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions