Skip to main content

spawn_subagents

Function spawn_subagents 

Source
pub fn spawn_subagents(
    agents: Vec<(String, String)>,
    model: Arc<RwLock<Box<dyn Model>>>,
    config: &ModelConfig,
    progress: Arc<Mutex<Vec<SubagentProgress>>>,
) -> (Vec<JoinHandle<SubagentResult>>, Vec<SubagentResult>)
Expand description

Spawn multiple subagents in parallel.

Returns JoinHandles so the caller can decide how to wait:

  • TUI: polls is_finished() with render_and_check_interrupt between checks
  • Non-interactive: join_all directly

Agents beyond MAX_CONCURRENT_AGENTS are returned as immediate failed results.