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
codex from a fresh Terminal session
- Inside Codex, prompt:
Run "pwd" and tell me the result
- Codex's LLM invokes the
exec_command tool
- 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.
Codex bug:
exec_commandfails with "Failed to create unified exec process"Suggested title for the issue:
Suggested repo:
openai/codexDescription
The
exec_commandtool fails on every invocation with:This makes it impossible for the Codex agent to run any shell command inside the session —
pwd,ls,sqlite3, anything.Environment
npm install -g @openai/codexReproduction
codexfrom a fresh Terminal sessionRun "pwd" and tell me the resultexec_commandtoolThings tried that did NOT fix it
npm install -g @openai/codex@latest) — the bug persistsrm -rf ~/.codex/.tmp ~/.codex/shell_snapshots/*— issue returned in subsequent sessionsDiagnostic from
~/.codex/logs_2.sqliteThe error suggests Codex is trying to spawn a helper binary (
unified-execof some sort) that's missing or unreachable from where it's looking.which zshreturns/bin/zshcleanly; not a shell-binary issue.Expected behavior
exec_commandspawns 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.