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 taskprompt- Prompt to send to the agentworking_dir- Working directory for the agentharness- Which AI harness to usemodel- Optional model override
§Returns
AgentResult after the subagent completes