picoclaw/pkg/agent
Paolo Anzani eb86e10e5c
fix(tools): propagate tool registry to subagents (#1711)
* fix(tools): propagate tool registry to subagents via Clone

SubagentManager was created with an empty ToolRegistry and SetTools()
was never called, causing all subagent tool invocations to fail with
"tool not found". This was a regression from the multi-agent refactor.

Fix: clone the parent agent's tool registry into the subagent manager
after creation but before spawn/spawn_status registration — giving
subagents access to file, exec, web, and other tools while preventing
recursive subagent spawning.

- Add ToolRegistry.Clone() for independent shallow copies
- Call subagentManager.SetTools(agent.Tools.Clone()) in registerSharedTools
- Add tests for Clone isolation, empty clone, and hidden tool state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(tools): fix cron_test build error and add TTL clone test

- Fix cron_test.go:229 — replace non-existent SubscribeOutbound(ctx)
  with select on OutboundChan(), matching the MessageBus channel API
- Add TestToolRegistry_Clone_PreservesTTLValue per reviewer feedback
- Add version reset note to Clone() doc comment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 00:17:16 +08:00
..
context.go refactor: centralize environment variable key constants (#1730) 2026-03-18 18:03:24 +08:00
context_cache_test.go feat(agent): include current sender in dynamic context (#1696) 2026-03-17 23:31:56 +08:00
context_test.go fix deepseek-chat bug (#1066) 2026-03-06 16:04:31 +08:00
instance.go fix(tools): allow sandbox access to temp media files 2026-03-14 12:02:06 +08:00
instance_test.go add systray ui for all platform (#1649) 2026-03-17 14:12:32 +08:00
loop.go fix(tools): propagate tool registry to subagents (#1711) 2026-03-19 00:17:16 +08:00
loop_mcp.go Fix/Add warning tips for MCP initialization when no valid servers configured (#1497) 2026-03-13 16:43:00 +08:00
loop_media.go feat: expose local file paths for non-image media to enable agent file tools (#1516) 2026-03-14 12:09:11 +08:00
loop_test.go Add model-native search (prefer_native) for OpenAI/Codex (#1618) 2026-03-18 11:55:30 +08:00
memory.go refactor(modernize): apply safe modernize fixes 2026-02-27 16:35:07 +08:00
mock_provider_test.go feat(fmt): Fix formatting 2026-02-19 22:05:15 +02:00
registry.go feat(session): integrate JSONL persistence into agent loop (#1170) 2026-03-10 15:14:09 +08:00
registry_test.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
thinking.go feat: add extended thinking support for Anthropic models (#1076) 2026-03-05 09:51:18 +08:00
thinking_test.go feat: add extended thinking support for Anthropic models (#1076) 2026-03-05 09:51:18 +08:00