Skip to content

Fix Windows Codex launch with PowerShell SHELL - #841

Closed
dhruvac29 wants to merge 1 commit into
openai:mainfrom
dhruvac29:fix-windows-codex-availability-832
Closed

dhruvac29 wants to merge 1 commit into
openai:mainfrom
dhruvac29:fix-windows-codex-availability-832

Conversation

@dhruvac29

Copy link
Copy Markdown

Summary

Fixes #832. On Windows, use Node's default command shell for Codex CLI availability checks and direct app-server launches, even when SHELL points to PowerShell. This selects npm's codex.cmd shim instead of a codex.ps1 shim that may be blocked by PowerShell execution policy.

Document the Windows launch behavior and add a Windows CI regression test that installs both fake shims, sets SHELL=powershell.exe, then verifies setup and a task run.

Verification

  • node --test tests/process.test.mjs tests/runtime.test.mjs — 63 passed, 1 Windows-only test skipped on macOS
  • npm run build — passed
  • git diff --check — passed

The Windows regression test will run in the new windows-shim CI job.

@dhruvac29
dhruvac29 requested review from a team and a balanced review from Copilot November 11, 2026 02:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T02:26:39.203061Z 8d558e5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@dhruvac29

Copy link
Copy Markdown
Author

Closing this PR because it was opened against the wrong repository for the intended contribution. Sorry for the noise.

@dhruvac29 dhruvac29 closed this Nov 11, 2026
@dhruvac29
dhruvac29 deleted the fix-windows-codex-availability-832 branch November 11, 2026 02:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d558e56d5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

shell: options.shell ?? (process.platform === "win32" ? (process.env.SHELL || true) : false),
// Windows npm shims are .cmd files. Let Node use the Windows command shell
// rather than SHELL, which may point to PowerShell and select codex.ps1.
shell: options.shell ?? (process.platform === "win32"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve Windows shims outside the checkout

When the plugin is run from an untrusted repository containing node.cmd or codex.cmd, shell: true delegates these bare command names to cmd.exe, whose normal lookup checks cwd before PATH; /codex:setup can therefore execute the repository's batch file as the user instead of the installed tool, and the changed app-server spawn does the same for codex. This newly exposes the SHELL=PowerShell users targeted by this change because PowerShell does not search the current directory by default, so resolve the intended shim from PATH to an absolute path before invoking it rather than relying on cmd lookup.

Useful? React with 👍 / 👎.

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: PowerShell SHELL causes codex.ps1 policy rejection to be reported as missing CLI

2 participants