Skip to content

fix: add shell: true to spawn() in app-server for Windows#54

Closed
0xZOne wants to merge 1 commit intoopenai:mainfrom
0xZOne:fix/windows-spawn-app-server
Closed

fix: add shell: true to spawn() in app-server for Windows#54
0xZOne wants to merge 1 commit intoopenai:mainfrom
0xZOne:fix/windows-spawn-app-server

Conversation

@0xZOne
Copy link
Copy Markdown

@0xZOne 0xZOne commented Mar 31, 2026

Summary

Fixes #53

  • Add shell: process.platform === "win32" to the spawn() call in SpawnedCodexAppServerClient.initialize() so that Node can resolve the codex .cmd shim on Windows.

This is the same fix as #13 applied to spawnSync in process.mjs, but the async spawn() in app-server.mjs was missed.

Test plan

  • Verified on Windows 11 with Node.js v22.17.0 and codex-cli 0.117.0
  • /codex:review successfully starts the app-server and completes review after the fix
  • No impact on macOS/Linux (condition is gated on process.platform === "win32")

…lity

On Windows, `codex` is installed as an npm `.cmd` shim. Node's
`child_process.spawn()` cannot resolve `.cmd` files without
`shell: true`, causing `ENOENT` when `SpawnedCodexAppServerClient`
tries to start `codex app-server`.

This is the same class of bug fixed in openai#13 for `spawnSync` in
`process.mjs`, but the async `spawn()` call in `app-server.mjs`
was missed.
@dkundel-openai
Copy link
Copy Markdown
Collaborator

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() in app-server.mjs fails with ENOENT on Windows

2 participants