picoclaw/pkg/tools
yinwm e7e3f95ebe feat: US-012 - Add ShellTool tests
Added comprehensive test coverage for ShellTool (ExecTool) with 9 test cases:
- TestShellTool_Success: Verifies successful command execution
- TestShellTool_Failure: Verifies failed command execution with IsError flag
- TestShellTool_Timeout: Verifies command timeout handling
- TestShellTool_WorkingDir: Verifies custom working directory support
- TestShellTool_DangerousCommand: Verifies safety guard blocks dangerous commands
- TestShellTool_MissingCommand: Verifies error handling for missing command
- TestShellTool_StderrCapture: Verifies stderr is captured and included
- TestShellTool_OutputTruncation: Verifies long output is truncated
- TestShellTool_RestrictToWorkspace: Verifies workspace restriction

ShellTool implementation already conforms to ToolResult specification:
- Success returns ForUser = command output
- Failure returns IsError = true
- ForLLM contains full output and exit code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 19:52:16 +08:00
..
base.go feat: US-006 - Add AsyncCallback type and AsyncTool interface 2026-02-12 19:35:41 +08:00
cron.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
cron.go.bak2 feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
cron.go.broken feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
edit.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
filesystem.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
message.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
message_test.go feat: US-011 - Add MessageTool tests 2026-02-12 19:50:53 +08:00
registry.go feat: US-008 - Inject callback into async tools in AgentLoop 2026-02-12 19:42:24 +08:00
result.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
result_test.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
shell.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
shell_test.go feat: US-012 - Add ShellTool tests 2026-02-12 19:52:16 +08:00
spawn.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
subagent.go Add memory system, debug mode, and tools 2026-02-11 00:14:23 +08:00
types.go * First commit 2026-02-09 19:20:19 +08:00
web.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00