exited -1 in 0ms: failed in sandbox
Resolved 💬 3 comments Opened Oct 8, 2025 by tekumara Closed Oct 30, 2025
What version of Codex is running?
0.45.0
Which model were you using?
gpt-5-codex
What platform is your computer?
Darwin 24.6.0 arm64 arm
What steps can reproduce the bug?
Run pyright (a type checker) on a python project with a type error:
❯ codex exec --full-auto 'run: node .venv/lib/*/site-packages/pyright/dist/index.js'
OpenAI Codex v0.45.0 (research preview)
--------
workdir: /private/tmp/gmodel
model: gpt-5-codex
provider: openai
approval: never
sandbox: workspace-write [workdir, /tmp, $TMPDIR]
reasoning effort: none
reasoning summaries: auto
session id: 0199c037-0559-74f2-a099-a57c2369ab6b
--------
user
run: node .venv/lib/*/site-packages/pyright/dist/index.js
thinking
**Preparing to run node command in bash shell**
exec
bash -lc 'node .venv/lib/*/site-packages/pyright/dist/index.js' in /private/tmp/gmodel exited -1 in 0ms:
failed in sandbox:
What is the expected behavior?
It shouldn't fail in the sandbox and should instead have:
- An accurate duration (it runs for more than 0ms)
- An exit code of 1 not -1 when type errors are detected
- The model should report the errors returned by pyright
What do you see instead?
The model thinks it's a sandbox or execution failure, and tries alternative ways of running pyright, eg:
thinking
**Troubleshooting command failure**
exec
bash -lc 'which node' ...
Additional information
When setting RUST_LOG=debug I can see from the decoded ExecCommandOutputDelta debug log lines that it completes running. The codex.tool_result otel event is:
2025-10-08T08:17:06.298255Z INFO codex_otel::otel_event_manager: event.name="codex.tool_result" event.timestamp=2025-10-08T08:17:06.298Z conversation.id=0199c2e4-fa7e-7dc3-a2d5-c355fb9a11a1 app.version=0.45.0 auth_mode="ApiKey" terminal.type=ghostty/1.2.1-main_a5aff0e34 model=gpt-5-codex slug=gpt-5-codex tool_name=shell call_id=call_GlUMDcp2Ez40iDtexgNq4gJO arguments={"command":["bash","-lc","node .venv/lib/*/site-packages/pyright/dist/index.js"],"workdir":"/private/tmp/gmodel","timeout_ms":120000} duration_ms=10713 success=false output=failed in sandbox:
Note that the following works correctly:
codex sandbox macos --full-auto bash -lc 'node .venv/lib/*/site-packages/pyright/dist/index.js'This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗