You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: PowerShell SHELL causes codex.ps1 policy rejection to be reported as missing CLI #832
On Windows, Codex plugin 1.0.6 reports that Codex is missing even though the installed CLI works independently. The availability check inherits a PowerShell SHELL, resolves the npm codex.ps1 shim, and encounters PSSecurityException / UnauthorizedAccess because script execution is disabled.
Observed environment
Plugin: codex@openai-codex 1.0.6
Codex CLI: 0.165.0, npm installation
Windows; SHELL points to Windows PowerShell
npm provides both codex.ps1 and codex.cmd
The exact execution-policy scope/value was not inspected. No claim is made about whether this is a local or centrally managed policy.
Reproduction / observed path
In an environment with the above existing conditions:
Invoke the installed plugin's getCodexAvailability(cwd).
It calls binaryAvailable("codex", ["--version"], { cwd }).
scripts/lib/process.mjs selects process.env.SHELL for Windows runCommand.
PowerShell selects codex.ps1 and rejects it. The sanitized error is: codex.ps1 cannot be loaded because running scripts is disabled, PSSecurityException, UnauthorizedAccess.
A task attempt reports Codex CLI is not installed or is missing required runtime support before dispatching a turn.
The availability function was checked directly and returned available: false with that policy error. In contrast, an earlier explicit codex.cmd --version invocation returned codex-cli 0.165.0; a standalone CLI smoke test also succeeded. This does not establish that plugin task execution succeeds.
Distinguish a shell/policy launch rejection from a missing CLI and provide a documented, policy-compatible Windows launch mechanism. Do not require users to weaken execution policy or sandbox/approval controls.
No execution-policy changes, shell substitution, or installed-plugin patches were used to bypass this rejection.
Related reports checked
#287 and #337 concern spawn codex ENOENT / shim resolution without a shell. This report concerns a shell-based availability check selecting the PowerShell shim and being rejected by policy, rather than ENOENT.
Activity