From 43d6c5bf17d9952881f4f085b120eb1b3e32ec67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rulong=20Chen=EF=BC=88=E9=99=88=E6=B1=9D=E9=BE=99=EF=BC=89?= Date: Tue, 31 Mar 2026 01:22:24 -0700 Subject: [PATCH] fix: add `shell: true` to spawn() in app-server for Windows compatibility 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 #13 for `spawnSync` in `process.mjs`, but the async `spawn()` call in `app-server.mjs` was missed. --- plugins/codex/scripts/lib/app-server.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/codex/scripts/lib/app-server.mjs b/plugins/codex/scripts/lib/app-server.mjs index abf3d0c..e0a15eb 100644 --- a/plugins/codex/scripts/lib/app-server.mjs +++ b/plugins/codex/scripts/lib/app-server.mjs @@ -188,7 +188,8 @@ class SpawnedCodexAppServerClient extends AppServerClientBase { 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" }); this.proc.stdout.setEncoding("utf8");