Skip to content

fix: add shell: true on Windows for codex app-server spawn#39

Closed
cadamsgcmlp wants to merge 1 commit intoopenai:mainfrom
cadamsgcmlp:fix/windows-spawn-enoent
Closed

fix: add shell: true on Windows for codex app-server spawn#39
cadamsgcmlp wants to merge 1 commit intoopenai:mainfrom
cadamsgcmlp:fix/windows-spawn-enoent

Conversation

@cadamsgcmlp
Copy link
Copy Markdown

Summary

On Windows, spawn("codex", ["app-server"], ...) in app-server.mjs fails with ENOENT because Node.js spawn without shell: true cannot resolve the .cmd wrappers that npm install -g creates.

This one-line fix adds shell: process.platform === "win32", matching the existing pattern in process.mjs line 12.

Fixes #32

Test plan

  • Verified locally on Windows 11 with Node v25.4.0 and @openai/codex 0.117.0
  • /codex:setup reports ready before and after the change
  • /codex:review --base <branch> fails with spawn codex ENOENT before the fix, completes successfully after

On Windows, npm installs global packages as .cmd batch wrappers.
Node.js spawn() without shell: true cannot resolve .cmd files,
causing ENOENT when launching the app-server.

This matches the existing pattern in process.mjs (line 12) where
runCommand and binaryAvailable already set shell on win32.

Fixes openai#32

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dkundel-openai
Copy link
Copy Markdown
Collaborator

Thank you! Closing in favor of #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spawn codex ENOENT on Windows — app-server.mjs missing shell: true for .cmd wrapper resolution

2 participants