test: bash tool PATH injection for .opencode/tools/ user tools#366
Conversation
Adds 3 integration tests verifying that the bash tool correctly prepends .opencode/tools/ directories to PATH, enabling user-created skill tools to execute without requiring manual PATH configuration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> https://claude.ai/code/session_01KTCZNzQYZW4RiAP7t4Y1x2
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdded test suite validating PATH injection behavior in BashTool. Tests verify custom tool execution from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
What does this PR do?
1. Bash tool PATH injection —
src/tool/bash.ts:166-210(3 new tests)The recent
skillCLI commit (d6a1e6b) added PATH prepend logic to the bash tool so that user-created tools in.opencode/tools/directories are automatically available during bash execution. Zero tests existed for this critical integration point. If PATH injection silently breaks,skill createwould generate tools that users can't execute — the most common failure mode for the new skill workflow.New coverage includes:
.opencode/tools/, runs it by name through the bash tool, and verifies it produces correct output — proving the PATH injection actually works end-to-end.opencode/tools/directories appear at most once in PATH, preventing PATH pollution across repeated bash tool invocationsaltimate-dbttake precedence over system commandsType of change
Issue for this PR
N/A — proactive test coverage for recently shipped
.opencode/tools/PATH injection featureHow did you verify your code works?
Checklist
https://claude.ai/code/session_01KTCZNzQYZW4RiAP7t4Y1x2
Summary by CodeRabbit