Pure scheduling policy for Subagent fan-out.
The subagent manager owns lifecycle, timers, logs, and child Sessions. This module owns only queue selection and concurrency decisions so those rules can be tested without starting BEAM processes or provider Turns.
Summary
Functions
Returns whether a new or queued Subagent can start under max_threads.
Returns the next queued agent that can start, preserving parent insertion order.
Counts currently running Subagents in a parent fan-out.
Functions
Returns whether a new or queued Subagent can start under max_threads.
Only agents with status "running" count against the limit. This preserves the
current Manager policy where terminal, detached, and queued agents do not
consume runtime slots.
Returns the next queued agent that can start, preserving parent insertion order.
Counts currently running Subagents in a parent fan-out.