From ec891b4edf16cdb2b7a19447f785e471d7d47dec Mon Sep 17 00:00:00 2001 From: Thomas Beaudouin Date: Sun, 3 May 2026 13:09:50 +0000 Subject: [PATCH] fix(subagents): scope allowlist agent id for multi_subagent --- pkg/agent/agent_init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/agent/agent_init.go b/pkg/agent/agent_init.go index 7a9f5866b..78817dcf2 100644 --- a/pkg/agent/agent_init.go +++ b/pkg/agent/agent_init.go @@ -306,10 +306,10 @@ func registerSharedTools( // spawn_status which are added below — preventing recursive // subagent spawning. subagentManager.SetTools(agent.Tools.Clone()) + currentAgentID := agentID if spawnEnabled { spawnTool := tools.NewSpawnTool(subagentManager) spawnTool.SetSpawner(NewSubTurnSpawner(al)) - currentAgentID := agentID spawnTool.SetAllowlistChecker(func(targetAgentID string) bool { return registry.CanSpawnSubagent(currentAgentID, targetAgentID) })