spawn_subagent

Function spawn_subagent 

Source
pub async fn spawn_subagent(
    task_id: String,
    prompt: String,
    working_dir: PathBuf,
    harness: Harness,
    model: Option<String>,
) -> Result<AgentResult, Error>
Expand description

Subagent spawn helper for use within extensions

Spawns a subagent for a specific task and returns its result. This is the primary interface for extensions that need to spawn child agents.

§Arguments

  • task_id - Identifier for the spawned task
  • prompt - Prompt to send to the agent
  • working_dir - Working directory for the agent
  • harness - Which AI harness to use
  • model - Optional model override

§Returns

AgentResult after the subagent completes