Codex Desktop sandboxed exec loses a running child process, allowing a deleted log to consume 205 GB
What version of the Codex App are you using (From “About Codex” dialog)?
26.721.41059 (5848); bundled codex-cli 0.146.0-alpha.3.1
What subscription do you have?
Pro
What platform is your computer?
Darwin 25.5.0 arm64 arm
What issue are you seeing?
Summary
Codex Desktop lost track of a still-running sandboxed child process. The child entered a high-speed interactive error loop and wrote to a redirected log under /tmp. The agent then deleted the visible log without terminating the child. Because the process still held the deleted file descriptor open, APFS continued allocating space invisibly until the disk was effectively full.
This was not a 205 GB archive. The input was a corrupted Playwright trace ZIP of only 63,546 bytes. The missing space was an unbounded error log held open after deletion.
Impact
- Available disk space fell from more than 200 GB to about 100 MB.
- Other Codex sessions began failing with disk-full / unable-to-write errors.
- Codex Desktop did not surface a low-disk warning or show that the child process was still running.
- Finder and
ducould not locate the missing space after the log was deleted. - When the child finally exited, approximately 205.6 GB was released immediately.
- This creates risk of application/database corruption and unnecessary SSD writes.
Observed process tree
launchd -> ChatGPT -> codex -> zsh -> zip
The runaway process was observed as PID 47113.
Exact failure sequence
- A corrupted Playwright
trace.zipcould not be read normally. - Codex ran
zip -FFagainst a copy in/tmpand redirected stdout/stderr to/tmp/080d-zipfix.log. - The exec tool returned after 10.2 seconds as if the script had completed, with no visible output, but the
zsh -> zipprocess continued running. zip -FFrepeatedly prompted for a missing split file,080d-trace-broken.z01, at very high speed.- Within roughly 16 seconds, the log had already reached 2,067,307,609 bytes (reported by
duas 2.4 GB), while the input ZIP remained 63,546 bytes. - Codex attempted
pgrep -fl 'zip -FF', but the sandbox returnedsysmon request failed with error: sysmond service not foundandpgrep: Cannot get process list. - Despite being unable to verify termination, Codex ran
rm -fon the log and temporary ZIP files. - The active
zipprocess kept writing to the now-deleted log inode. The allocation became invisible to normal file searches but remained visible indf/APFS usage. - The process continued for about 45 minutes and consumed roughly 205.6 GB before exiting.
Session
- Thread ID:
019f9c7d-dcd3-7911-b3f5-122a737c32ec - Originator: Codex Desktop
- History mode: legacy
- Workspace paths and application code details have been redacted.
What steps can reproduce the bug?
This is the observed reproduction. Please use a strict file-size limit if attempting to reproduce; the original behavior can exhaust the disk.
- In Codex Desktop with the
workspace-writesandbox, run a shell-wrapped command that invokeszip -FFon a malformed/truncated ZIP that is interpreted as a missing split archive. - Redirect its output to a writable temp file:
zip -FF /tmp/broken.zip --out /tmp/fixed.zip >/tmp/zipfix.log 2>&1
- Let the exec call yield after approximately 10 seconds.
- Observe whether Codex retains and surfaces the running terminal/session ID. In this incident, the outer tool result said the script completed while the child remained active.
- From inside the macOS sandbox, try to inspect the child with
pgrep; it may fail withsysmond service not found. - If the output path is unlinked while the child is still writing,
duno longer shows the space, butdfcontinues falling until the child exits.
The repeating output was the interactive prompt for the missing .z01 split file. A safe reproduction should cap output/file size and terminate the entire process group after a few seconds.
What is the expected behavior?
- A yielded or timed-out exec command must remain visible as a running background terminal with a retained session/kill handle.
- If the session handle is dropped or the turn is aborted, Codex should terminate the entire process group, not only the shell wrapper.
- The sandbox should allow Codex to inspect and terminate child processes that Codex itself created.
- Interactive commands running without usable stdin should time out or fail instead of spinning indefinitely on EOF.
- Codex should warn and pause when a task is consuming disk rapidly or free space crosses a critical threshold.
- Temp/task storage should have a quota or another backpressure mechanism so one runaway command cannot exhaust the host disk.
- The UI should clearly warn when a process keeps an unlinked file open and disk space is not reclaimed.
Additional information
Environment and measurements
- Codex App:
26.721.41059 (5848) - Bundled Codex CLI:
0.146.0-alpha.3.1 - macOS:
Darwin 25.5.0 arm64 - Sandbox:
workspace-write - Input archive: 63,546 bytes
- Runaway log after about 16 seconds: 2,067,307,609 bytes / 2.4 GB allocated
- APFS container free space during incident: about 95.8 GB and falling
- APFS container free space after child exit: about 301.4 GB
- Immediate recovery: about 205.6 GB
- Final available space after recovery: about 281 GiB
Related issues
This appears related to, but is not an exact duplicate of:
- #26869 — Codex Desktop app-server loses child processes and writes excessive logs after crash/restart. It overlaps in process-lifecycle symptoms, but this report has a deterministic single-command trigger and a 205.6 GB deleted-open temp log.
- #8656 — background tasks keep spinning and macOS sandbox blocks
pgrep - #4337 — shell wrapper timeout does not terminate child processes
- #7852 — sandboxed exec leaves orphaned child processes
- #4775 — default timeout and feedback for shell commands
- #22444 — deleted files remain allocated because Codex processes hold descriptors open
- #16886 — unbounded Codex logs filling disks
- #34061 — Codex session data exhausting APFS volumes without quotas or warnings
I have retained the local session evidence and can provide a redacted diagnostic excerpt or submit it through /feedback if requested. I have not attached the full session because it contains private prompts, local paths, and tool output.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I encountered the same core Codex Desktop child-process lifecycle and deleted-open-file failure, with a more severe outcome: the Mac exhausted disk, RAM, and swap, then watchdog-reset.
Environment:
Sanitized failure sequence:
OLD_DIGEST="" NEW_DIGEST="sha256:..." perl -0pi -e 's/\Q$ENV{OLD_DIGEST}\E/$ENV{NEW_DIGEST}/g' seal-config.json
This corroborates the containment requests in this issue, especially retaining and surfacing a kill handle for yielded execs, terminating the entire process group when a task is superseded or cleanup begins, and enforcing disk/output/resource backpressure. It also shows that deleting/replacing visible paths without first proving process termination can turn the hidden allocation into a host-crash condition.
I have retained the full Codex session JSONL, panic report, reset report, unified-log timeline, process attribution, file-growth measurements, and a 221-line forensic incident report. I am not posting those publicly because they contain private prompts, local paths, and project metadata. I can provide redacted excerpts here or the complete evidence through a private OpenAI Support channel if maintainers request it.