claudetool: add just-in-time tool installation for bash commands
Implements automatic tool installation when bash commands use missing tools,
providing a seamless experience for the LLM to Just Use tools it knows ought to exist.
Core Features:
1. Command Analysis Pipeline:
- Parse bash commands to extract individual tools/programs
- Use exec.LookPath to check if tools exist in PATH
- Handle shell built-ins, absolute/relative paths correctly
- Support complex command chaining with &&, ||, ;, and |
2. Subagent Tool Installation:
- Spawn dedicated subagents to install missing tools
The system preserves existing bash tool behavior while adding invisible
tool installation. Original commands run regardless of installation
success/failure, avoiding agent confusion.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: s226cd6260a6469e9k
diff --git a/test/timeout_test.go b/test/timeout_test.go
index 6e78098..64c4158 100644
--- a/test/timeout_test.go
+++ b/test/timeout_test.go
@@ -10,7 +10,7 @@
func TestBashTimeout(t *testing.T) {
// Create a bash tool
- bashTool := claudetool.NewBashTool(nil)
+ bashTool := claudetool.NewBashTool(nil, claudetool.NoBashToolJITInstall)
// Create a command that will output text and then sleep
cmd := `echo "Starting command..."; echo "This should appear in partial output"; sleep 5; echo "This shouldn't appear"`