Windows: OpenAI BYOK login reports npm install failed (exit 1), but npm exits 0 — Command Code 1.65.0
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
- Domain
- cli, developer-experience, tooling
Research direction
Look for the Windows subprocess wrapper handling npm install for BYOK providers. The fix prompt mentions running the install in a dedicated provider/cache directory with an explicit cwd. Start by finding where provider installation is triggered in /connect, then examine the process spawning logic. Check how exit codes, stdout, and stderr are captured. Verify the fix by testing on Windows with an existing project's node_modules to ensure no unintended pruning occurs.
Written by the indexing model from the issue text.
Description
Summary
On Windows, selecting OpenAI ChatGPT/Codex in /connect makes provider installation fail, so the ChatGPT OAuth login cannot start. Command Code reports exit 1, but npm debug logs show that the install actually completed with exit 0.
Expected Behavior
The on-demand provider install should run in an isolated provider directory rather than inheriting the user project working directory, should report failure only when npm actually returns a non-zero status, and should continue to the OpenAI OAuth flow after a successful install. It must not prune or otherwise alter unrelated dependencies in the user project node_modules.
Actual Behavior
The UI aborts with: npm install @byokkit/cmd-provider-openai@0.1.2 failed (exit 1): Das System kann den angegebenen Pfad nicht gefunden. However, the corresponding npm debug log ends with: verbose exit 0 / info ok. All registry requests return HTTP 200, the package and dependencies are extracted, and package.json plus dist/index.js exist at the attempted install target. Repeated attempts installed the package in in the active repository. The latter install caused npm to retire/remove unrelated packages from the repository node_modules. Login remains blocked because Command Code interprets the subprocess result as exit 1.
Steps to reproduce the issue
- Use Windows 11 with Command Code 1.65.0, Node.js 22.19.0, and npm 11.13.0.
- Start Command Code in a directory that already has a package.json and node_modules.
- Run /connect and select OpenAI ChatGPT/Codex.
- Attempt to sign in.
- Compare the displayed error with the newest npm debug log in %LOCALAPPDATA%/npm-cache/_logs. The UI says exit 1, while npm ends with verbose exit 0 and info ok.
Command Code Version
1.65.0
Operating System
Windows
Terminal/IDE
WezTerm
Shell
cmd.exe
Session file (optional)
No response
Fix prompt (optional)
Inspect the Windows subprocess wrapper used for on-demand BYOK provider installation. Make the provider install run in a dedicated provider/cache directory with an explicit cwd instead of inheriting the active project directory. Capture and interpret the real process exit status, stdout, stderr, and spawn errors correctly; npm output ending in exit 0 must be treated as success. Only surface the Windows path error when a real spawn error or non-zero npm result occurred. After success, verify that @byokkit/cmd-provider-openai can be imported before starting OAuth. Add Windows regression tests for a project with existing unrelated node_modules, a successful npm exit 0, and a genuine missing command/path error. Verify that provider installation never prunes or rewrites project dependencies.
Additional context
Environment: Windows 11 build 26100; Command Code 1.65.0, current npm latest; Node.js v22.19.0; npm 11.13.0; WezTerm; cmd.exe. npm evidence: command npm install Abyokkit/cmd-provider-openai@0.1.2; registry requests returned HTTP 200; log contains silly ADD node_modules/@byokkit/cmd-provider-openai; log ends with verbose exit 0 and info ok. Installed files include dist/index.js and dist/codex.js. An isolated reproduction using npm install --prefix with a scratch directory also succeeded and added 9 packages. No API keys, OAuth tokens, auth.json contents, or session transcript are included.
- Dominant language
- No language data
- Stars
- 4k
- Forks
- 350
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CommandCodeAI/command-code
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#903 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#855 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CommandCodeAI/command-code#841 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#655 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#608 ·
All issues in CommandCodeAI/command-code
Similar issues
-
`--app` focus through the daemon can pick an off-screen window and refuse with `axElementNotFound` Openclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster no-stale P1
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
state:needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
zed-industries/zed#64742 · 1 comment ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gitbutlerapp/gitbutler#16066 ·
-
make dev prints the runtime default model (gpt-5.6-terra), not the app's text model (gpt-5.6-sol) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
eandualem/avatar-studio#68 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100