Windows: app-server.mjs spawn('codex') fails with ENOENT due to missing shell:true

Open Beginner friendly
#16,296 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
javascript, node.js
Domain
cli, tooling

Research direction

Start in scripts/lib/app-server.mjs at the spawn call around line 188, then compare the process spawning options in scripts/lib/process.mjs around line 11. Confirm the Windows app-server launch uses the same platform-specific shell behavior, and verify that the Codex app-server starts successfully in the reported Windows setup.

Written by the indexing model from the issue text.

Description

bug extension windows-os

Bug Description

On Windows, the Claude Code plugin's codex-companion.mjs fails to start the Codex app-server with spawn codex ENOENT when running adversarial-review or other commands that use the app-server runtime.

Root Cause

In scripts/lib/app-server.mjs line 188, spawn("codex", ["app-server"]) is called without shell: true. On Windows, npm global binaries are installed as .cmd wrappers, and Node.js spawn cannot resolve .cmd files without shell: true.

The fix already exists in scripts/lib/process.mjs line 11 (shell: process.platform === "win32"), but was not applied to app-server.mjs.

Steps to Reproduce

  1. Windows 11 with Node.js managed via fnm (or any npm global install)
  2. Install Codex globally: npm install -g @openai/codex
  3. Install the Codex plugin in Claude Code
  4. Run /codex:setup — succeeds (uses process.mjs which has shell: true)
  5. Run /codex:adversarial-review — fails with spawn codex ENOENT

Fix

// scripts/lib/app-server.mjs line 188
    this.proc = spawn("codex", ["app-server"], {
      cwd: this.cwd,
      env: this.options.env,
-     stdio: ["pipe", "pipe", "pipe"]
+     stdio: ["pipe", "pipe", "pipe"],
+     shell: process.platform === "win32"
    });

Environment

  • OS: Windows 11 (10.0.26200)
  • Node.js: v22.22.0 (managed via fnm)
  • codex-cli: 0.117.0
  • Claude Code plugin: codex 1.0.1
Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.