pub async fn agent_loop(
prompts: Vec<AgentMessage>,
context: &mut AgentContext,
config: &AgentLoopConfig,
tx: UnboundedSender<AgentEvent>,
cancel: CancellationToken,
) -> Vec<AgentMessage>Expand description
Start an agent loop with new prompt messages.
Appends prompts to context, runs the full hook/event lifecycle (see module doc),
and returns only the messages produced by this call. Events are pushed to tx in real time.