Fix Windows shell execution with paths containing spaces#211
Conversation
On Windows, when agent binaries are located in paths containing spaces (e.g., C:\Program Files\nodejs\opencode.cmd), cmd.exe splits the unquoted path at the space character, causing "'C:\Program' is not recognized" errors. Added quoteForWindowsShell() utility that wraps paths in double quotes when they contain spaces, applied to all spawn() calls using shell: true on Windows: - BaseAgentPlugin.execute() startProcess - BaseAgentPlugin.detect() default implementation - All agent runVersion() methods (claude, opencode, codex, gemini, kiro) - DroidAgentPlugin custom execute override Closes #206 https://claude.ai/code/session_01Y5dUsC9kGyyZn9zuvpXLNq
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #211 +/- ##
==========================================
+ Coverage 45.02% 45.04% +0.01%
==========================================
Files 84 84
Lines 24403 24411 +8
==========================================
+ Hits 10988 10995 +7
- Misses 13415 13416 +1
🚀 New features to boost your workflow:
|
Fix Windows shell execution with paths containing spaces
Summary
Fixes issue #206 by properly quoting command paths containing spaces when executing with
shell: trueon Windows. When Node.jsspawn()is used withshell: trueon Windows, paths with spaces must be wrapped in double quotes to prevent cmd.exe from splitting them at the space character.Changes
quoteForWindowsShell()insrc/plugins/agents/base.tsthat intelligently quotes paths only when necessary (contains spaces and not already quoted)runVersion()andexecute()methods to quote command paths on Windows before spawningquoteForWindowsShell()and integration tests verifying proper quoting behavior in version detection across multiple agent pluginsImplementation Details
quoteForWindowsShell()function is a pure utility that:platform() === 'win32') and only whenshell: trueis used