pub fn agent_loop(
ctx: AgentContext,
config: AgentLoopConfig,
prompts: Vec<Message>,
cancel: CancellationToken,
) -> AgentEventStreamExpand description
Start an agent loop as a background task and return its event stream. The
loop appends prompts to a copy of the context, runs to completion, and
terminates with a single AgentEvent::AgentEnd carrying the final
transcript. Each run is independent (the caller owns the live transcript).