Skip to content

fix: add shell option for Windows spawn in app-server#47

Closed
alexhuang0915 wants to merge 1 commit intoopenai:mainfrom
alexhuang0915:fix/win32-spawn-shell
Closed

fix: add shell option for Windows spawn in app-server#47
alexhuang0915 wants to merge 1 commit intoopenai:mainfrom
alexhuang0915:fix/win32-spawn-shell

Conversation

@alexhuang0915
Copy link
Copy Markdown

Summary

  • On Windows, npm global binaries (like codex) are installed as .cmd wrappers
  • spawn("codex", [...]) in app-server.mjs without shell: true causes ENOENT because Node.js cannot resolve .cmd files directly
  • Added shell: process.platform === "win32" to match the existing pattern in process.mjs line 11

Reproduction

  1. Install Codex plugin on Windows via claude plugins install codex@openai-codex
  2. Run /codex:rescue or any task that triggers app-server startup
  3. Observe spawn codex ENOENT error

Fix

One-line change: add shell: process.platform === "win32" to the spawn() options in SpawnedCodexAppServerClient.initialize().

This is consistent with how process.mjs already handles Windows compatibility for all other codex binary invocations via runCommand().

Test plan

  • Verified codex setup --json still reports ready: true
  • Verified codex-companion.mjs task completes successfully on Windows
  • No impact on non-Windows platforms (condition is platform-gated)

🤖 Generated with Claude Code

On Windows, npm global binaries are installed as `.cmd` wrappers.
Node.js `spawn()` without `shell: true` cannot resolve these,
causing `ENOENT` when launching `codex app-server`.

This matches the pattern already used in `process.mjs` line 11:
`shell: process.platform === "win32"`

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.

2 participants