Repository navigation
Start npm-shim vendor CLIs directly on Windows - #1487
Conversation
Availability resolves a bare name through PATHEXT and finds npm's .cmd shim, but a shell-less spawn reaches only .exe, so OpenCode, Gemini and Copilot were offered and then failed to launch. The shim's own target is started so cmd.exe never parses vendor arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every Windows launch is refused on platform, yet availability looked only at the binary, so the app offered a vendor that could only fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
PR Summary by QodoLaunch npm-shim vendor CLIs directly on Windows
AI Description
Diagram
High-Level Assessment
Files changed (12)
|
Code Review by Qodo
1. Windows version checks still fail
|
| var (program, script) = Resolve(psi.FileName, binaries.Resolve, NpmCmdShim.TryRead); | ||
| psi.FileName = program; | ||
| if (script is not null) { | ||
| if (string.IsNullOrEmpty(psi.Arguments)) psi.ArgumentList.Insert(0, script); | ||
| else psi.Arguments = $"\"{script}\" {psi.Arguments}"; | ||
| } |
There was a problem hiding this comment.
1. Windows version checks still fail 📎 Requirement gap ☼ Reliability
VendorVersionResolver.Resolve starts the .cmd path returned by BinaryProbe without applying WindowsLaunchCommand, so Windows still attempts to launch the npm shim directly without its Node target. Any Muse, Pi, or Antigravity version probe that resolves to an npm .cmd shim therefore reports an unknown version and can incorrectly make the vendor unavailable.
Agent Prompt
## Issue description
WindowsLaunchCommand is applied to vendor launches, but VendorVersionResolver still starts the `.cmd` path returned by BinaryProbe directly. Version probes for npm-installed Muse, Pi, or Antigravity CLIs can therefore fail and report an unknown version on Windows.
## Fix Focus Areas
- src/Capacitor.Cli.Daemon/Services/WindowsLaunchCommand.cs[12-20]
- src/Capacitor.Cli.Core/VendorVersionResolver.cs[10-22]
## Recommended Fix
Apply the Windows launch transformation to the ProcessStartInfo used by VendorVersionResolver, passing the same BinaryProbe instance, so `.cmd` shims are replaced with their native executable or Node script target before Process.Start. Add a Windows-focused test that resolves a vendor version through an npm shim and verifies the transformed executable and arguments.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Closes #1486 — AI-3780
What & why
On Windows the app offered OpenCode, Gemini and Copilot, and every launch failed: availability finds npm's
.cmdshim through PATHEXT, but the daemon spawns the bare name without a shell, which reaches only.exe.WindowsLaunchCommandresolves the command with the sameBinaryProbeand starts an npm shim's own target (node.exe script, or its native.exe), so cmd.exe never parses vendor arguments. It is a no-op off Windows. Antigravity, refused on Windows on platform, is no longer advertised there (#1485 tracks real support).Where to look
ProcessStartInfobuilder, so builder tests are unchanged.Verification
Win32Exception (2)Win32Exception (2)Win32Exception (2)From the desktop app on this branch, OpenCode, Copilot, Kiro, Pi and Codex launch and answer. Daemon suite on Windows: 4,171 run, 15 failed — 14 symlink tests needing Developer Mode, 1 ConPTY job-object test on a path this change does not touch.
🤖 Generated with Claude Code
Summary by CodeRabbit