codex - 💡(How to fix) Fix Sandboxed command execution hangs without output for simple commands [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20807Fetched 2026-05-03 04:45:06
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4closed ×1commented ×1unlabeled ×1

Error Message

Simple commands should either complete normally and return output, or fail with a clear error message. They should not hang silently.

Root Cause

Impact: This makes debugging difficult because it is unclear whether the command is blocked by the project, Git, the shell, the sandbox, or the PTY/output layer. It can also lead to unnecessary retries or escalation outside the sandbox.

RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.128.0

What subscription do you have?

Pro Lite

Which model were you using?

GPT-5.5 high

What platform is your computer?

6.18.18-1-MANJARO x86_64 unknown

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

WarpTerminal v0.2026.04.27.15.32.stable_03 dumb /usr/bin/zsh

What issue are you seeing?

Commands executed in the sandboxed environment sometimes hang indefinitely without producing any stdout or stderr. This affects even simple commands that should complete immediately, such as pwd, sed, and git status.

Observed behavior:

  • git status --short --branch produced no output and appeared to hang.
  • sed -n ... also produced no output.
  • pwd did not return promptly either.
  • Running the equivalent Git command outside the sandbox completed immediately and returned the expected status.

Expected behavior: Simple commands should either complete normally and return output, or fail with a clear error message. They should not hang silently.

Impact: This makes debugging difficult because it is unclear whether the command is blocked by the project, Git, the shell, the sandbox, or the PTY/output layer. It can also lead to unnecessary retries or escalation outside the sandbox.

Evidence: In the affected repository, git status --short --branch hung in the sandbox. When rerun outside the sandbox, it immediately returned:

main...origin/main

D " " ?? .codex/

Likely area: Sandboxed command execution, PTY handling, stdout/stderr buffering, or filesystem access mediation.

Suggested investigation:

  • Check whether sandboxed commands are blocked before process startup or during output collection.
  • Verify whether stdout/stderr is being buffered or not flushed back to the caller.
  • Compare behavior between sandboxed and non-sandboxed execution for short-lived commands.
  • Add timeout diagnostics that report whether the process started, whether output was captured, and where execution is blocked.

thread ID 019de9ca-8125-7013-b67f-bedd6a28f230

What steps can reproduce the bug?

Uploaded thread: 019de9ca-8125-7013-b67f-bedd6a28f230

What is the expected behavior?

No response

Additional information

No response

extent analysis

TL;DR

Investigate sandboxed command execution and PTY handling to resolve the issue of commands hanging indefinitely without producing output.

Guidance

  • Check if sandboxed commands are blocked before process startup or during output collection to identify the root cause of the issue.
  • Verify whether stdout/stderr is being buffered or not flushed back to the caller, as this could be causing the commands to hang.
  • Compare the behavior of short-lived commands between sandboxed and non-sandboxed execution to isolate the problem.
  • Add timeout diagnostics to report whether the process started, whether output was captured, and where execution is blocked to gain more insight into the issue.

Example

No code snippet is provided as the issue does not contain sufficient information to create a relevant example.

Notes

The issue seems to be related to the sandboxed environment and PTY handling, but further investigation is needed to determine the exact cause. The provided information suggests that the problem is not with the commands themselves, but rather with how they are being executed in the sandboxed environment.

Recommendation

Apply workaround: Implement timeout diagnostics and investigate sandboxed command execution to identify and resolve the root cause of the issue. This approach is recommended as it allows for a more targeted investigation and potential resolution of the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Sandboxed command execution hangs without output for simple commands [1 comments, 2 participants]