Pixir.Subagents.Scheduler (pixir v0.1.7)

Copy Markdown View Source

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

can_start?(agents, max_threads)

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.

next_startable(agents)

Returns the next queued agent that can start, preserving parent insertion order.

running_count(agents)

Counts currently running Subagents in a parent fan-out.