fix: use conditional shell in runVersion for claude and opencode agents#187
fix: use conditional shell in runVersion for claude and opencode agents#187
Conversation
Only use shell when spawning version check on Windows. On Unix-like systems, the command path is already resolved so shell invocation is unnecessary. This matches the pattern already used by newer agent plugins (codex, gemini, kiro) and reduces shell spawning overhead on Linux/macOS.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
WalkthroughConditional shell usage was added to Claude and OpenCode agent version checks: spawn now sets Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files
🚀 New features to boost your workflow:
|
Add comprehensive tests for the runVersion method's platform-specific shell option in claude and opencode agent plugins. Changes: - Apply PR #187 fix: use shell: process.platform === 'win32' instead of shell: true in runVersion for both claude.ts and opencode.ts - Add new test file (runversion-shell.test.ts) that mocks spawn and verifies the shell option is correctly set based on platform - Add tests for Linux, macOS (shell: false) and Windows (shell: true) - Add tests for detect() success/failure scenarios - Add getSandboxRequirements tests to claude-agent.test.ts The tests achieve 100% coverage on the changed lines and >50% overall coverage on both affected files.
Add comprehensive tests for the runVersion method's platform-specific shell option in claude and opencode agent plugins. Changes: - Apply PR #187 fix: use shell: process.platform === 'win32' instead of shell: true in runVersion for both claude.ts and opencode.ts - Add new test file (runversion-shell.test.ts) that mocks spawn and verifies the shell option is correctly set based on platform - Add tests for Linux, macOS (shell: false) and Windows (shell: true) - Add tests for detect() success/failure scenarios - Add getSandboxRequirements tests to claude-agent.test.ts The tests achieve 100% coverage on the changed lines and >50% overall coverage on both affected files.
Add comprehensive tests for the runVersion method's platform-specific shell option in claude and opencode agent plugins. Changes: - Apply PR subsy#187 fix: use shell: process.platform === 'win32' instead of shell: true in runVersion for both claude.ts and opencode.ts - Add new test file (runversion-shell.test.ts) that mocks spawn and verifies the shell option is correctly set based on platform - Add tests for Linux, macOS (shell: false) and Windows (shell: true) - Add tests for detect() success/failure scenarios - Add getSandboxRequirements tests to claude-agent.test.ts The tests achieve 100% coverage on the changed lines and >50% overall coverage on both affected files.
fix: use conditional shell in runVersion for claude and opencode agents
Summary
shell: process.platform === 'win32') inrunVersionmethod for bothclaude.tsandopencode.tsagent pluginsCloses #183
Test plan
bun run typecheckpassesbun run buildsucceedsSummary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.