exec_command CreateProcess failed: os error 2

Open 💬 2 comments Opened Jul 29, 2026 by jsfyq917-crypto
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

150.0.7871.128 (26.721.41059)

What subscription do you have?

Free

What platform is your computer?

apple的MacBook Pro,Intel Core i9

What issue are you seeing?

对,改:

所有 exec_command 调用失败,报错 CreateProcess failed: os error 2,跨所有线程。完全退出 Codex 重启也无法恢复。

What steps can reproduce the bug?

填:

  1. 打开 Codex App,在任意线程中密集使用(命令行操作、代码编辑、打包等),持续 8 小时以上
  2. exec_command 全部失败,报 CreateProcess failed: os error 2
  3. 所有工具(Node REPL、知识图谱、子 Agent)相继失效
  4. 完全退出 Codex 重启也无法修复

What is the expected behavior?

填:

exec_command 应持续可靠工作,不受使用时长影响。如出现异常应有自动恢复机制,而非全面崩溃且重启无效。

Additional information

填:

macOS 自带 Terminal 完全正常,/bin/zsh 可正常使用。仅 Codex App 内所有进程创建均失败,疑为沙箱或进程管理器长期运行后资源耗尽。附:Workspace dependencies 中有 bundled Python 和 Node,但均无法调用。

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 1 month ago

English translation:

What version of the Codex App are you using (From “About Codex” dialog)?

150.0.7871.128 (26.721.41059)

What subscription do you have?

Free

What platform is your computer?

Apple MacBook Pro, Intel Core i9

What issue are you seeing?

Yes, change it to:

All exec_command calls fail with the error CreateProcess failed: os error 2 across all threads. Completely quitting and restarting Codex does not resolve the issue.

What steps can reproduce the bug?

Enter:

  1. Open the Codex App and use it intensively in any thread (command-line operations, code editing, packaging, etc.) continuously for more than 8 hours
  2. All exec_command calls fail with CreateProcess failed: os error 2
  3. All tools (Node REPL, knowledge graph, sub-Agents) stop working one after another
  4. Completely quitting and restarting Codex does not fix it

What is the expected behavior?

Enter:

exec_command should continue working reliably regardless of how long it has been in use. If an error occurs, there should be an automatic recovery mechanism instead of a complete failure that cannot be resolved by restarting.

Additional information

Enter:

The built-in macOS Terminal works normally, and /bin/zsh can be used without issues. Process creation fails only within the Codex App, possibly due to resource exhaustion in the sandbox or process manager after running for an extended period. Note: Workspace dependencies include bundled Python and Node, but neither can be invoked.

<!-- codex-issue-translator -->

jsfyq917-crypto · 1 month ago

Bug Description

After roughly 12+ hours of continuous use across a single session, all exec_command calls fail with:

CreateProcess failure for /bin/zsh -c '...':
"Rejected(\"Failed to create unified exec process: No such file or directory (os error 2)\")"

Impact

  • Cannot run ANY shell commands
  • Node REPL (js_reset, js) also fails
  • Knowledge graph MCP tools eventually degrade
  • Sub-agents (spawn_agent) inherit the same broken state
  • Spans across ALL threads, even newly created ones

Reproduction

  1. Open Codex on macOS
  2. Intensive use for 8+ hours (multiple exec_command calls, asar packing, Electron dev)
  3. Shell eventually dies across all threads
  4. Only fix: kill Codex process and restart

Workaround

  • Fully quit Codex (⌘Q) and reopen

Environment

  • macOS (Apple Silicon)
  • Codex desktop app (latest)
  • zsh as default shell

写哪里?