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.
This commit is contained in:
parent
521359ed4f
commit
52f0c541b5
1 changed files with 2 additions and 0 deletions
|
|
@ -119,6 +119,8 @@ func registerSharedTools(cfg *config.Config, msgBus *bus.MessageBus, registry *A
|
||||||
|
|
||||||
// Spawn tool with allowlist checker
|
// Spawn tool with allowlist checker
|
||||||
subagentManager := tools.NewSubagentManager(provider, agent.Model, agent.Workspace, msgBus)
|
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)
|
spawnTool := tools.NewSpawnTool(subagentManager)
|
||||||
currentAgentID := agentID
|
currentAgentID := agentID
|
||||||
spawnTool.SetAllowlistChecker(func(targetAgentID string) bool {
|
spawnTool.SetAllowlistChecker(func(targetAgentID string) bool {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue