pub async fn run_loop_interactive<F, Fut>(
agent: &dyn Agent,
tools: &ToolRegistry,
ctx: &mut AgentContext,
messages: &mut Vec<Message>,
config: &LoopConfig,
on_event: impl FnMut(LoopEvent),
on_input: F,
) -> Result<usize, AgentError>Expand description
Run the agent loop with interactive input support.
When a tool returns ToolOutput::waiting, the loop pauses and calls on_input
with the question. The returned string is injected as the tool result, then the loop continues.
This is the interactive version of run_loop — use it when the agent may need
to ask the user questions (via ClarificationTool or similar).