Skip to content

fix(windows): avoid unspawnable Deep Scan launchers - #367

Open
kmbroai wants to merge 1 commit into
mainfrom
dev/kyleb/windows-deep-scan-launcher
Open

fix(windows): avoid unspawnable Deep Scan launchers#367
kmbroai wants to merge 1 commit into
mainfrom
dev/kyleb/windows-deep-scan-launcher

Conversation

@kmbroai

@kmbroai kmbroai commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Normalize CODEX_CLI_PATH at the nested Deep Scan MCP environment boundary.
  • On Windows, preserve explicit direct executables while rejecting extensionless npm shims, .cmd shims that require a shell, and protected WindowsApps binaries.
  • Fall back to the existing resolveCodexCommand() platform-binary resolver instead of adding another launcher resolver.

Root cause

Deep Scan workers inherit CODEX_CLI_PATH through the plugin MCP environment. Before this change, any non-empty value bypassed the canonical npm platform-binary resolver. On Windows that value can be the extensionless npm shim or a protected MSIX WindowsApps executable; CodexExec passes it directly to child_process.spawn without a shell, which can fail with spawn EPERM even when the installed @openai/codex platform package contains a valid executable.

This keeps case-insensitive Windows environment propagation intact, preserves explicit spawnable .exe / .com launchers, and uses the existing bundled platform executable when the inherited value cannot be launched.

Related: CLI-18410, codex#35872.

Validation

  • bun test tests-ts/runtime.test.ts --test-name-pattern 'bundled Codex through|explicit Codex executable override|spawnable Windows' — 3 passed
  • pnpm run types
  • pnpm run build
  • pnpm run format
  • pnpm pack --pack-destination ../../dist
  • pnpm run test:package — validated the installed package and a nested worker without global codex
  • Native prepublish review gate: 3 independent passes plus verifier; 0 findings

The full runtime.test.ts module was also attempted, but this host reports / and /home as UID 65534, so 24 unrelated trusted-owner tests fail closed. The launcher-focused tests and package smoke pass without weakening those checks.

@kmbroai kmbroai changed the title [codex-security] Avoid unspawnable Windows Deep Scan launchers fix(windows): avoid unspawnable Deep Scan launchers Aug 12, 2026
@github-actions github-actions Bot added the bug Something isn't working label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant