Repository navigation
Fix Codex CLI quota fallback startup on Windows - #5
cash-flow-king wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thanks for this — your diagnosis was exactly right. npm installs Codex behind a A fix is now shipped in v0.13.1 — https://github.com/llblab/pi-codex-usage/releases/tag/v0.13.1 (commit What shipped, compared with this PR:
So I'm closing this as superseded — not because the approach was wrong, but because the shipped version covers the same failure. If you have hit a layout it misses (for example the older bundled |
10.0.26300/263001.1.024.14.111.12.10.162.1, installed globally through npm0.13.0(02a23c0)Problem
The Codex CLI fallback fails to start on Windows when Codex is installed through npm.
Running
codex --versionin a terminal works, but the extension’s directspawn("codex", …)fails with:The npm installation exposes a
codex.cmdshim that the terminal can launch, but the extension’s shell-free launch method does not resolve it to the actual executable.This became visible when the primary quota endpoint started returning HTTP 401. With the CLI fallback also unavailable, quota refreshes repeatedly failed. The extension retained its last good report for an hour, then displayed
errorin both clients.Changes
codex.exeand launch it directly without a shell.Launching the native executable directly also keeps process disposal attached to the actual app-server process rather than an intermediate shell or Node wrapper.
Validation
On Windows:
npm run validatepassed.git diff --checkpassed.codex-cli 0.162.1.Fallback recovery and failure cases use local fixtures and do not require subscription credentials or live quota requests.
Windows/Linux GitHub Actions jobs are configured but have not run yet.
Scope and limitations
This PR fixes Windows CLI fallback startup, not the primary endpoint’s HTTP 401 response. The reason for that access-enforcement rejection remains unconfirmed.
Quota normalization, shared refresh coordination, and Fast behavior are unchanged. The separate Fast-related fork changes are not included.
Assisted by Pi.