codex-plugin-cc/plugins/codex
ZETA 1a79ae57ec
fix: resolve Windows ENOENT when spawning codex app-server (#55)
* fix: add shell and windowsHide options for Windows spawn in app-server

On Windows, spawn("codex", ["app-server"]) fails with ENOENT because
Node.js cannot resolve .cmd shims without shell: true. This adds
platform-gated shell and windowsHide options to the app-server spawn
call, and uses terminateProcessTree for proper process tree cleanup
since shell: true wraps the child in cmd.exe.

Without terminateProcessTree, plain SIGTERM only kills cmd.exe and
leaves the actual codex node process orphaned — verified with 274+
zombie node.exe processes accumulating on Windows.

Fixes #32
Fixes #46

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: guard terminateProcessTree against PID reuse after process exit

ChildProcess.killed only reflects whether .kill() was called by this
process — it stays false when the child exits on its own. On Windows,
where PIDs are recycled quickly, the 50 ms timer could fire after
cmd.exe has exited and its PID has been reassigned, causing taskkill
to terminate an unrelated process.

Add an exitCode === null check so the tree-kill path is skipped once
the child has already exited.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 12:39:32 -07:00
..
.claude-plugin Bump v1.0.1 (#22) 2026-03-30 19:23:08 -07:00
agents Initial commit 2026-03-30 09:42:33 -07:00
commands Initial commit 2026-03-30 09:42:33 -07:00
hooks Initial commit 2026-03-30 09:42:33 -07:00
prompts Initial commit 2026-03-30 09:42:33 -07:00
schemas Initial commit 2026-03-30 09:42:33 -07:00
scripts fix: resolve Windows ENOENT when spawning codex app-server (#55) 2026-03-31 12:39:32 -07:00
skills Initial commit 2026-03-30 09:42:33 -07:00
CHANGELOG.md Initial commit 2026-03-30 09:42:33 -07:00
LICENSE Initial commit 2026-03-30 09:42:33 -07:00
NOTICE Initial commit 2026-03-30 09:42:33 -07:00