pub async fn build_agent(
intent: &str,
generator: &dyn TurnGenerator,
executor: &WorktreeExecutor,
cfg: &BuildAgentConfig,
) -> BuildAgentOutcomeExpand description
Generate an agent spec from intent, run its scenarios, and repair until
they pass. Tool names the model invents that aren’t in available_tools
are dropped (the allowlist can only contain real tools).