codex sandbox linux panics on non-Linux platforms instead of returning a clear error

Open 💬 1 comment Opened Feb 5, 2026 by saianilsingi

What version of Codex CLI is running?

codex-cli 0.97.0

What subscription do you have?

ChatGPT Plus

Which model were you using?

Not applicable (CLI bug occurs before any model invocation)

What platform is your computer?

Darwin 24.6.0 x86_64 i386

What terminal emulator and version are you using (if applicable)?

Terminal.app (macOS)

What issue are you seeing?

The codex sandbox linux subcommand is exposed on non-Linux platforms and panics at runtime instead of returning a clear, user-friendly error.

Running this command on macOS causes an immediate panic because the CLI attempts to invoke a Linux-only helper binary that is not present on non-Linux systems.

Error output observed on macOS:

thread 'main' panicked at codex-rs/cli/src/debug_sandbox.rs:234:18:
codex-linux-sandbox executable not found
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

What steps can reproduce the bug?

  1. On a non-Linux platform (macOS)
  2. Install the official Codex CLI binary (for example via Homebrew):

brew install --cask codex

  1. Run:

codex sandbox linux -- echo hi

What is the expected behavior?

The CLI should return a clear, actionable error indicating that the Linux sandbox subcommand is only supported on Linux platforms, and exit gracefully without a panic.

Additional information

  • Reproduced using the released Codex CLI binary (not a local development build).
  • The panic occurs before any Linux-specific sandbox execution.
  • The Linux sandbox subcommand is registered without platform gating, and the CLI uses expect(...) when the Linux-only helper binary is missing.

Relevant code locations:

  • codex-rs/cli/src/main.rs (SandboxCommand::Linux)
  • codex-rs/cli/src/debug_sandbox.rs (run_command_under_sandbox)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗