refactor: Share tool registry with subagent and add note
This commit is contained in:
parent
d9e900cf29
commit
0e85bdf79c
1 changed files with 2 additions and 0 deletions
|
|
@ -179,6 +179,8 @@ func registerSharedTools(
|
||||||
// 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)
|
||||||
subagentManager.SetLLMOptions(agent.MaxTokens, agent.Temperature)
|
subagentManager.SetLLMOptions(agent.MaxTokens, agent.Temperature)
|
||||||
|
// CRITICAL: Share the same tool registry with subagent so it has access to all tools
|
||||||
|
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