Repository navigation
fix(hook): match namespaced bash tool name in the Vibe hook - #4356
Conversation
Vibe's Unified Harness sends the shell tool as file_system.bash, which the exact tool_name == "bash" check skipped, so no command was rewritten. Compare the last dot-separated segment instead.
📊 Automated PR Analysis
SummaryFixes the Vibe hook so it correctly rewrites bash commands when the tool name is namespaced (e.g. Review Checklist
Linked issues: #4355 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
|
Reviewed and verified against mistral-vibe's source (harness One suggestion: matching on the last segment also rewrites MCP tools named if !matches!(tool_name, "bash" | "file_system.bash") {Ready for maintainer review once that's decided. |
aeppling
left a comment
There was a problem hiding this comment.
Thanks for picking this up!
Matching the last segment also rewrites plugin tools: Vibe names those {group}.{tool} (_hook_matcher.py#L85), so docker.bash becomes rtk git status and breaks wherever rtk isn't installed. Vibe's own code checks its shell by exact name (_shell_tools.py#L49).
Fix: matches!(tool_name, "bash" | "file_system.bash") + a test that myplugin.bash returns None.
Matching the last dot-segment also accepted any plugin tool ending in .bash (e.g. myplugin.bash). Accept only bash and file_system.bash.
|
Pushed d47ef69: The Vibe hook now matches the tool name exactly against |
aeppling
left a comment
There was a problem hiding this comment.
Thanks! Verified on current develop: suite green, and only bash and file_system.bash are rewritten, plugin *.bash tools are left alone.
Summary
Fixes #4355.
tool_namewas exactlybash, but Vibe's Unified Harness sends the shell tool asfile_system.bash, so nothing was rewritten. The hook now compares the last dot-separated segment of the name. Other namespaced tools such asfile_system.read_fileare still ignored.Test plan
cargo fmt --all && cargo clippy --all-targets && cargo test(not run in full; onlycargo test test_vibe, which passes: 38 passed, 0 failed)rtk <command>output inspected (not done; covered by the two new unit tests)