picoclaw/pkg/tools
King Tai cb0c8703fb
test(tools,utils): add ToolRegistry unit tests and fix Truncate panic on negative maxLen (#517)
Add comprehensive unit tests for the ToolRegistry covering registration,
lookup, execution, context injection, async callbacks, schema generation,
provider definition conversion, and concurrent access.

Fix a defensive edge case in Truncate where a negative maxLen would cause
a slice bounds panic, and add table-driven tests covering boundary
conditions, zero/negative lengths, and Unicode handling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-22 21:40:59 +11:00
..
base.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
cron.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
edit.go feat(linter): Fix govet linter 2026-02-20 22:35:16 +02:00
edit_test.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
filesystem.go feat(linter): Fix govet linter 2026-02-20 22:35:16 +02:00
filesystem_test.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
i2c.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
i2c_linux.go feat(linter): Fix govet linter 2026-02-20 22:35:16 +02:00
i2c_other.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
message.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
message_test.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
registry.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
registry_test.go test(tools,utils): add ToolRegistry unit tests and fix Truncate panic on negative maxLen (#517) 2026-02-22 21:40:59 +11:00
result.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
result_test.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
shell.go fix (security): ExecTool working_dir sandbox escape (#478) 2026-02-21 08:15:46 +08:00
shell_process_unix.go fix(exec): terminate process tree on timeout 2026-02-18 02:01:29 +08:00
shell_process_windows.go fix(exec): terminate process tree on timeout 2026-02-18 02:01:29 +08:00
shell_test.go fix: golangci-lint run --fix 2026-02-21 16:20:15 +08:00
shell_timeout_unix_test.go feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
skills_install.go feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
skills_install_test.go feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
skills_search.go feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
skills_search_test.go feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
spawn.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
spi.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
spi_linux.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
spi_other.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
subagent.go Merge branch 'main' into fix-formatting 2026-02-19 22:04:48 +02:00
subagent_tool_test.go feat(fmt): Fix formatting 2026-02-19 22:05:15 +02:00
toolloop.go Merge branch 'main' into fix-formatting 2026-02-20 20:02:53 +02:00
types.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
web.go Merge branch 'main' into fix-formatting 2026-02-19 22:04:48 +02:00
web_test.go feat(fmt): Fix formatting 2026-02-19 22:05:15 +02:00