exec_command tool consistently fails with "Failed to create unified exec process: No such file or directory (os error 2)"
Open 💬 3 comments Opened May 2, 2026 by someshds
Codex bug: exec_command fails with "Failed to create unified exec process"
Suggested title for the issue:
exec_command tool consistently fails with "Failed to create unified exec process: No such file or directory (os error 2)"
Suggested repo: openai/codex
---
Description
The exec_command tool fails on every invocation with:
CreateProcess { message: "Rejected(\"Failed to create unified exec process: No such file or directory (os error 2)\")" }
This makes it impossible for the Codex agent to run any shell command inside the session — pwd, ls, sqlite3, anything.
Environment
- codex-cli: 0.128.0 (also reproduced on 0.125.0)
- macOS: 14.x (Apple Silicon iMac)
- Shell: zsh 5.9 (default macOS)
- Installed via
npm install -g @openai/codex
Reproduction
- Launch Codex with
codexfrom a fresh Terminal session - Inside Codex, prompt:
Run "pwd" and tell me the result - Codex's LLM invokes the
exec_commandtool - Tool fails with the error above; no shell command executes
Things tried that did NOT fix it
- Updating from 0.125.0 to 0.128.0 (
npm install -g @openai/codex@latest) — the bug persists rm -rf ~/.codex/.tmp ~/.codex/shell_snapshots/*— issue returned in subsequent sessions- Restarting Terminal / opening fresh shells
Diagnostic from ~/.codex/logs_2.sqlite
level=ERROR target=codex_core::session::handlers
error=exec_command failed for `/bin/zsh -lc "<command>"`:
CreateProcess { message: "Rejected(\"Failed to create unified exec process: No such file or directory (os error 2)\")" }
The error suggests Codex is trying to spawn a helper binary (unified-exec of some sort) that's missing or unreachable from where it's looking. which zsh returns /bin/zsh cleanly; not a shell-binary issue.
Expected behavior
exec_command spawns the shell, runs the requested command, returns its stdout/stderr.
Workaround
None — the tool is fully blocked. User has to copy-paste commands into a separate Terminal window, defeating the agentic-coding workflow.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗