Skip to content

spawn() in app-server.mjs fails with ENOENT on Windows #53

Description

@0xZOne

Bug description

On Windows, running /codex:review or any command that triggers SpawnedCodexAppServerClient fails with:

spawn codex ENOENT

Root cause

codex is installed via npm as a .cmd shim on Windows. In plugins/codex/scripts/lib/app-server.mjs line 188, spawn("codex", ["app-server"], ...) is called without shell: true. Node's child_process.spawn() cannot resolve .cmd files without the shell option, resulting in ENOENT.

This is the same class of bug that was fixed in #13 for spawnSync in process.mjs, but the async spawn() call in app-server.mjs was missed.

Steps to reproduce

  1. Install the Codex plugin on Windows via Claude Code marketplace
  2. Install Codex CLI: npm install -g @openai/codex
  3. Authenticate: codex login
  4. Run /codex:review in Claude Code

Expected: Review runs successfully
Actual: spawn codex ENOENT

Environment

  • OS: Windows 11
  • Node.js: v22.17.0
  • codex-cli: 0.117.0
  • codex-plugin-cc: v1.0.1

Fix

Add shell: process.platform === "win32" to the spawn() options in app-server.mjs, consistent with the approach in #13.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions