mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
refactor(agent): simplify delegate registration gate
Remove the IsToolEnabled("delegate") check — there is no "delegate"
entry in ToolsConfig, so the check was always true. The only real
gate is len(agents) > 1, which is the intended behavior: delegate
is auto-registered in multi-agent setups.
Ref: #2148
This commit is contained in:
+4
-3
@@ -442,9 +442,10 @@ func registerSharedTools(
|
||||
}
|
||||
|
||||
// Register delegate tool for multi-agent setups.
|
||||
// Delegation uses the SubTurn mechanism directly (not SubagentManager),
|
||||
// so it does not depend on the subagent tool being enabled.
|
||||
if cfg.Tools.IsToolEnabled("delegate") && len(registry.ListAgentIDs()) > 1 {
|
||||
// Auto-enabled when multiple agents exist. Delegation uses the SubTurn
|
||||
// mechanism directly (not SubagentManager) and is independent of the
|
||||
// subagent tool.
|
||||
if len(registry.ListAgentIDs()) > 1 {
|
||||
delegateTool := tools.NewDelegateTool()
|
||||
delegateTool.SetSpawner(NewSubTurnSpawner(al))
|
||||
currentAgentID := agentID
|
||||
|
||||
Reference in New Issue
Block a user