Skip to content

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

@cadamsgcmlp

Description

@cadamsgcmlp

Summary

On Windows, all review and task commands fail with spawn codex ENOENT because SpawnedCodexAppServerClient in scripts/lib/app-server.mjs uses child_process.spawn("codex", ...) without shell: true. Node.js spawn on Windows uses CreateProcessW, which only resolves .exe binaries — not the .cmd wrappers that npm install -g creates.

Environment

  • OS: Windows 11 Enterprise 10.0.26100
  • Node: v25.4.0
  • npm: 11.7.0
  • Codex CLI: @openai/codex 0.117.0 (installed globally via npm)
  • Plugin version: latest from marketplace

Steps to Reproduce

  1. Install Codex globally on Windows: npm install -g @openai/codex
  2. Run /codex:setup — reports ready: true, all checks pass
  3. Run /codex:review --base <branch> — fails with:
spawn codex ENOENT

Root Cause

The codebase already handles this correctly in scripts/lib/process.mjs — both runCommand and binaryAvailable set shell: process.platform === "win32" (line 12), which is why /codex:setup succeeds.

However, scripts/lib/app-server.mjs line 188 spawns the app server without this flag:

// app-server.mjs:188-192
this.proc = spawn("codex", ["app-server"], {
  cwd: this.cwd,
  env: this.options.env,
  stdio: ["pipe", "pipe", "pipe"]
});

Suggested Fix

Add the same platform-aware shell option already used in process.mjs:

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

Verified locally — reviews and tasks run successfully after this one-line change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions