From 3c24b48b64046968d09c3728fe78e1c1ade1ee76 Mon Sep 17 00:00:00 2001 From: Omid Rajabi Date: Mon, 30 Mar 2026 17:23:48 -0400 Subject: [PATCH] fix: add `shell: true` on Windows so spawnSync can resolve .cmd shims On Windows, Node.js `spawnSync` without `shell: true` uses `CreateProcess`, which only resolves `.exe` files. npm installs global tools (like `codex`) as `.cmd` shims, so `spawnSync("codex", ...)` returns ENOENT even when codex is correctly installed and on PATH. Adding `shell: process.platform === "win32"` routes through `cmd.exe` on Windows, which properly resolves `.cmd`, `.bat`, and PATHEXT entries. No behavior change on macOS/Linux since the condition evaluates to false. --- plugins/codex/scripts/lib/process.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/codex/scripts/lib/process.mjs b/plugins/codex/scripts/lib/process.mjs index 000ecd2..b145ad8 100644 --- a/plugins/codex/scripts/lib/process.mjs +++ b/plugins/codex/scripts/lib/process.mjs @@ -7,7 +7,8 @@ export function runCommand(command, args = [], options = {}) { env: options.env, encoding: "utf8", input: options.input, - stdio: options.stdio ?? "pipe" + stdio: options.stdio ?? "pipe", + shell: process.platform === "win32" }); return {