You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Subagent fan-out is bounded by depth but not by breadth #38960
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
subagent_depth bounds how deep a subagent tree can go. Nothing bounds how wide it gets.
A subagent that spawns children in a loop will keep spawning — each child is a real session with real token spend — and the only thing that stops it is someone noticing. Depth 1 hides this today because subagents cannot spawn at all, but that is a side effect of the default, not a guard. Raising subagent_depth removes the only thing standing between a buggy prompt and unbounded fan-out.
The failure mode that matters is sequential, not concurrent: a subagent dispatching one child, waiting, dispatching another, indefinitely. A concurrent-only limit would not see it.
Suggested behaviour
A subagent_max_children config option, enforced at spawn time.
Two details that are easy to get wrong:
Root sessions should be exempt. A root orchestrator legitimately dispatches hundreds of subagents over a long session. Capping that breaks normal use. The pathological case is a subagent spawning many children, not a human-driven root doing so.
The count should be lifetime, not concurrent — otherwise the sequential loop above passes straight through.
changed the title [-]Subagent fan-out is bounded by depth but not by breadth[/-][+][FEATURE]: Subagent fan-out is bounded by depth but not by breadth[/+]on Jul 26, 2026
Activity
[-]Subagent fan-out is bounded by depth but not by breadth[/-][+][FEATURE]: Subagent fan-out is bounded by depth but not by breadth[/+]github-actions commentedon Sep 25, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.