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:
parent
6db17b8211
commit
6ee66123f2
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue