Skip to content

exec_command tool consistently fails with "Failed to create unified exec process: No such file or directory (os error 2)" #20770

@someshds

Description

@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

  1. Launch Codex with codex from a fresh Terminal session
  2. Inside Codex, prompt: Run "pwd" and tell me the result
  3. Codex's LLM invokes the exec_command tool
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtool-callsIssues related to tool calling

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions