fix: remove the max subagent logic

This commit is contained in:
Richard Tang
2026-02-23 10:35:55 -08:00
parent 04bac93c14
commit a0a5b10df0
2 changed files with 7 additions and 24 deletions
+7 -19
View File
@@ -1353,25 +1353,13 @@ class EventLoopNode(NodeProtocol):
elif tc.tool_name == "delegate_to_sub_agent":
# --- Framework-level subagent delegation ---
max_sa = getattr(ctx.node_spec, "max_sub_agents", 3) or 0
if max_sa and len(pending_subagent) >= max_sa:
result = ToolResult(
tool_use_id=tc.tool_use_id,
content=(
f"Sub-agent limit reached ({max_sa} per turn). "
"Wait for current sub-agents to finish before delegating more."
),
is_error=True,
)
results_by_id[tc.tool_use_id] = result
else:
# Queue for parallel execution in Phase 2
logger.info(
"🔄 LLM requesting subagent delegation: agent_id='%s', task='%s'",
tc.tool_input.get("agent_id", "?"),
(tc.tool_input.get("task", "")[:100] + "...") if len(tc.tool_input.get("task", "")) > 100 else tc.tool_input.get("task", ""),
)
pending_subagent.append(tc)
# Queue for parallel execution in Phase 2
logger.info(
"🔄 LLM requesting subagent delegation: agent_id='%s', task='%s'",
tc.tool_input.get("agent_id", "?"),
(tc.tool_input.get("task", "")[:100] + "...") if len(tc.tool_input.get("task", "")) > 100 else tc.tool_input.get("task", ""),
)
pending_subagent.append(tc)
else:
# --- Real tool: check for truncated args, else queue ---
-5
View File
@@ -209,11 +209,6 @@ class NodeSpec(BaseModel):
default_factory=list,
description="Node IDs that can be invoked as subagents from this node",
)
max_sub_agents: int = Field(
default=3,
description="Max concurrent subagent delegations per turn. 0 = unlimited.",
)
# For function nodes
function: str | None = Field(
default=None, description="Function name or path for function nodes"