Skip to content

exited -1 in 0ms: failed in sandbox #4928

Closed

Description

@tekumara

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:

  1. An accurate duration (it runs for more than 0ms)
  2. An exit code of 1 not -1 when type errors are detected
  3. 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'

Activity

  1. added
    bug
    on Oct 8, 2025
  2. github-actions commented on Oct 8, 2025

    @github-actions
    Contributor
  3. tekumara commented on Oct 10, 2025

    @tekumara
    ContributorAuthor

    I think this is a duplicate of #4859. Will test the fix in #4874 when released.

  4. kentyman23 commented on Oct 23, 2025

    @kentyman23

    #4874 is in. Should this be closed?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions