From 52f0c541b5f38da5d3b14989cd31f5467914a49c Mon Sep 17 00:00:00 2001 From: codywon <290923628@qq.com> Date: Fri, 20 Feb 2026 01:17:45 +0800 Subject: [PATCH] fix(agent): share agent tools with subagent manager SubagentManager was created with an empty ToolRegistry, causing subagents to have no access to file operations (read_file, write_file, exec, etc.). This fix shares the parent agent's tools with subagents. --- pkg/agent/loop.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index 6d0a61375..142181dda 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -119,6 +119,8 @@ func registerSharedTools(cfg *config.Config, msgBus *bus.MessageBus, registry *A // Spawn tool with allowlist checker subagentManager := tools.NewSubagentManager(provider, agent.Model, agent.Workspace, msgBus) + // Share the agent's tools with subagent so it can execute file operations, etc. + subagentManager.SetTools(agent.Tools) spawnTool := tools.NewSpawnTool(subagentManager) currentAgentID := agentID spawnTool.SetAllowlistChecker(func(targetAgentID string) bool {