fix: remove the max subagent logic
This commit is contained in:
@@ -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 ---
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user