Summary
Codex Security 0.1.14 Deep Scans fail before discovery on Windows when CODEX_CLI_PATH is unset and PATH resolves codex to the extensionless npm shim.
The Deep Scan worker ultimately calls Node's child_process.spawn with the literal command codex. On this PATH layout, Windows selects %APPDATA%\npm\codex (the extensionless npm shim) and Node returns EPERM. The plugin should resolve a Windows-executable launcher (codex.cmd / codex.exe) or use the Codex executable bundled with the desktop app.
Environment
- Windows 10.0.26200.8894, x64
- ChatGPT desktop app 26.721.4979.0
- Codex Security plugin 0.1.14 (hosted catalog)
- Codex CLI: reproduced with 0.145.0; the minimal launcher reproduction remains on 0.146.0
- Node.js v24.15.0
- PowerShell 5.1.26100.8894
- Codex CLI installed globally through npm
CODEX_CLI_PATH unset
Steps to reproduce
- On Windows, install Codex CLI globally through npm so
%APPDATA%\npm is on PATH and contains the extensionless codex shim.
- Leave
CODEX_CLI_PATH unset.
- In the ChatGPT desktop app with Codex Security 0.1.14, start a Deep Security Scan on a local Git repository.
- Complete setup and allow the preflight to pass.
- Wait for discovery workers to launch.
Actual behavior
Deep discovery terminates immediately with spawn EPERM. No worker completes and no candidates are produced. Sanitized coordinator result:
{
"status": "failed",
"discoveryCount": 0,
"failure": {
"phase": "discovery",
"message": "spawn EPERM",
"kind": "Error:EPERM"
}
}
The standalone launcher behavior is reproducible:
node -e "const {spawn}=require('child_process'); spawn('codex',['--version'])"
# Error: spawn EPERM
Spawning the direct npm-installed codex.exe from Node succeeds and prints codex-cli 0.146.0.
Expected behavior
Deep Scan should resolve and launch a valid Windows Codex executable without requiring users to configure CODEX_CLI_PATH manually.
Workaround
Set CODEX_CLI_PATH to the direct npm-installed codex.exe and restart the desktop app.
Suggested fix
On Windows, avoid passing the bare literal codex to child_process.spawn when the extensionless npm shim may win PATH resolution. Resolve codex.cmd / codex.exe, use the SDK's platform binary resolver, or pass the desktop-bundled executable path to the plugin MCP process.
Summary
Codex Security 0.1.14 Deep Scans fail before discovery on Windows when
CODEX_CLI_PATHis unset andPATHresolvescodexto the extensionless npm shim.The Deep Scan worker ultimately calls Node's
child_process.spawnwith the literal commandcodex. On this PATH layout, Windows selects%APPDATA%\npm\codex(the extensionless npm shim) and Node returnsEPERM. The plugin should resolve a Windows-executable launcher (codex.cmd/codex.exe) or use the Codex executable bundled with the desktop app.Environment
CODEX_CLI_PATHunsetSteps to reproduce
%APPDATA%\npmis onPATHand contains the extensionlesscodexshim.CODEX_CLI_PATHunset.Actual behavior
Deep discovery terminates immediately with
spawn EPERM. No worker completes and no candidates are produced. Sanitized coordinator result:{ "status": "failed", "discoveryCount": 0, "failure": { "phase": "discovery", "message": "spawn EPERM", "kind": "Error:EPERM" } }The standalone launcher behavior is reproducible:
Spawning the direct npm-installed
codex.exefrom Node succeeds and printscodex-cli 0.146.0.Expected behavior
Deep Scan should resolve and launch a valid Windows Codex executable without requiring users to configure
CODEX_CLI_PATHmanually.Workaround
Set
CODEX_CLI_PATHto the direct npm-installedcodex.exeand restart the desktop app.Suggested fix
On Windows, avoid passing the bare literal
codextochild_process.spawnwhen the extensionless npm shim may win PATH resolution. Resolvecodex.cmd/codex.exe, use the SDK's platform binary resolver, or pass the desktop-bundled executable path to the plugin MCP process.