fix(deep-scan): avoid unspawnable Windows Codex paths - #366
Open
kmbroai wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
CODEX_CLI_PATHfor nested Deep Scan workers on Windows only when it names a directly spawnable.exeor.comlauncher outsideWindowsApps.CODEX_CLI_PATHkeys before forwarding the MCP/worker environment.resolveCodexCommand()platform-package resolver for extensionless npm shims, batch launchers, blank values, and protected WindowsApps executables.codex.exe, extensionless npmcodex,codex.cmd, and a WindowsAppscodex.exe.Why
The bundled Deep Scan executor passes
CODEX_CLI_PATHto@openai/codex-sdkascodexPathOverride, and that SDK launches it directly withchild_process.spawn. The public SDK already forwards the exact uppercase variable through the MCP manifest, but it previously trusted every nonblank inherited value. On Windows that can select either the extensionless npm shim or the desktop app's protectedC:\Program Files\WindowsApps\...\codex.exe; both fail before discovery withspawn EPERM, even though the package's native platform executable is available.This keeps explicit executable overrides working while using the existing bundled resolver for launchers Node cannot directly spawn. It does not change sandbox settings.
Links: CLI-18410, openai/codex#35872
Validation
/home/dev-user/.bun/bin/bun test tests-ts/runtime.test.ts --test-name-pattern 'uses only directly spawnable Windows Codex overrides for nested workers'pnpm run types,pnpm run format, andpnpm run buildTMPDIR=/home/dev-user/.codex-security-cli18410-temp /home/dev-user/.bun/bin/bun test --timeout 30000 ./tests-ts(1,039 pass, 10 expected skips, 0 fail)pnpm pack --pack-destination ../../distandpnpm run test:package(installed-package nested worker smoke passed)codex review --base origin/main(no actionable findings)