Skip to content

fix: prevent Windows ENOENT for codex availability checks#162

Closed
Abdooo2235 wants to merge 1 commit intoopenai:mainfrom
Abdooo2235:fix/windows-codex-spawnshell-161
Closed

fix: prevent Windows ENOENT for codex availability checks#162
Abdooo2235 wants to merge 1 commit intoopenai:mainfrom
Abdooo2235:fix/windows-codex-spawnshell-161

Conversation

@Abdooo2235
Copy link
Copy Markdown

Summary

Fixes a Windows command resolution failure where Codex availability checks could fail with ENOENT even when codex was installed globally and available in PATH.

On Windows, command resolution can require shell execution for PATH-resolved shims. This change keeps Windows shell behavior and adds explicit regression coverage for it.

Closes #161.

Changes

  • Updated command runner to make platform/spawn implementation injectable for tests while preserving behavior:
    • shell now resolves from options.shell ?? platform === "win32"
    • added platform and spawnSyncImpl test hooks
  • Added regression tests to ensure:
    • Windows uses shell: true for PATH-resolved commands
    • non-Windows does not force shell mode

Validation

  • npm test (pass)
  • includes new tests in tests/process.test.mjs for Windows/non-Windows shell behavior

Risk

Low. Change is scoped to process invocation wiring and covered by targeted and full-suite tests.

@Abdooo2235 Abdooo2235 requested a review from a team April 6, 2026 14:00
@dkundel-openai
Copy link
Copy Markdown
Collaborator

Thanks this should have been fixed in #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: codex-companion.mjs fails with ENOENT because spawnSync can't resolve 'codex' in PATH

2 participants