-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Unified exec caches stale ~/.codex/tmp/arg0 session path and fails with ENOENT until app restart #16970
Description
What version of Codex is running?
codex 26.325.31654 app
codex-cli 0.118.0-alpha.2
What subscription do you have?
plus
Which model were you using?
gpt-5.3 Codex (Codex desktop default coding model)
What platform is your computer?
Windows 11 + WSL2
Linux kernel: Linux 6.6.87.2-microsoft-standard-WSL2 x86_64
What issue are you seeing?
In an active Codex Desktop thread, non-escalated tool execution suddenly fails with ENOENT from unified exec.
The failing spawn target points to a temp runtime path under ~/.codex/tmp/arg0/<session>/codex-linux-sandbox that no longer exists.
After restarting the app, a new codex-arg0* runtime folder is created and tool execution works again.
What steps can reproduce the bug?
Intermittent, but this sequence reproduces it for me:
- Start Codex Desktop in a WSL-backed workspace.
- Use normal tool calls for a while (
exec_command,apply_patch, etc.). - At some point, all non-escalated
exec_commandcalls fail immediately. - Error references a specific stale temp path:
.../tmp/arg0/codex-arg06KNIXk/codex-linux-sandbox ... ENOENT - Confirm that folder no longer exists.
- Restart Codex Desktop.
- A new folder appears (example:
codex-arg0nHm5Gj) containingcodex-linux-sandbox, and commands succeed again.
What is the expected behavior?
If an ephemeral codex-arg0* runtime folder is missing/rotated, unified exec should automatically rebind/recreate sandbox shims instead of hard-failing until full app restart.
What do you see instead?
Exact error captured in session log:
Failed to create unified exec process: Unable to spawn /mnt/c/Users/<redacted>/.codex/tmp/arg0/codex-arg06KNIXk/codex-linux-sandbox because it doesn't exist on the filesystem (ENOENT: No such file or directory)
Additional information
I checked related issues before filing:
- Agent cannot edit files using the sandbox when resuming a session #3947 (
codex-linux-sandbox ... not providedon resumed sessions) - No such file or directory (OS error 2) #4754 (generic
os error 2) - Codex CLI becomes unusable if the working directory from which it was launched is moved or removed #2252 (
os error 2after env/path changes)
This report is specifically about a stale ~/.codex/tmp/arg0/codex-arg* runtime path being referenced by unified exec during an active desktop session.
Local evidence:
- Failing log:
/mnt/c/Users/<redacted>/.codex/sessions/2026/04/07/rollout-2026-04-07T10-37-51-019d655f-d19c-75e0-9fea-dc5638991fd9.jsonl
(entry timestamp2026-04-07T01:06:04.320Z) - Missing stale folder after failure:
~/.codex/tmp/arg0/codex-arg06KNIXk(not found) - Healthy after restart:
~/.codex/tmp/arg0/codex-arg0nHm5Gj/codex-linux-sandbox -> ~/.codex/bin/wsl/codex
### Sanitized diagnostic excerpt
[2026-04-07T01:06:04.320Z]
exec_command failed for `/bin/bash -lc ''`: CreateProcess {
message: "Rejected(\"Failed to create unified exec process: Unable to spawn /mnt/c/Users/<redacted>/.codex/tmp/arg0/codex-arg06KNIXk/codex-linux-sandbox because it doesn't exist on the filesystem (ENOENT: No such file or directory)\")"
}
[2026-04-07T01:09:36.879Z]
Command: /bin/bash -lc 'ls -la /mnt/c/Users/<redacted>/.codex/tmp/arg0/codex-arg06KNIXk 2>/dev/null || true'
Output: <empty> (folder missing)
[2026-04-07T01:17:00.619Z]
Command: /bin/bash -lc 'ls -la /mnt/c/Users/<redacted>/.codex/tmp/arg0'
Output:
... codex-arg0nHm5Gj
[2026-04-07T01:17:21.860Z]
Command: /bin/bash -lc 'ls -la /mnt/c/Users/<redacted>/.codex/tmp/arg0/codex-arg0nHm5Gj'
Output:
... codex-linux-sandbox -> /mnt/c/Users/<redacted>/.codex/bin/wsl/codex
[2026-04-07T01:18:04Z]
`pwd` and `node -v` succeed again in the same workspace after restart.
Environment:
- codex-cli 0.118.0-alpha.2
- Windows 11 + WSL2
Root-cause hypothesis:
- Unified exec/harness caches a per-session sandbox shim path under
tmp/arg0. - If that ephemeral folder is removed/rotated, the cached path is reused and all non-escalated spawns fail with ENOENT.
High-level fix suggestion:
- On ENOENT for the sandbox shim path, force a one-time runtime rehydrate/rebind:
- recreate the per-session symlink in a fresh
codex-arg0*folder, or - fall back to
~/.codex/bin/wsl/codexand rebuild session shims.
- recreate the per-session symlink in a fresh