pub async fn run_agent_loop(
provider: Arc<dyn Provider>,
model: &str,
system_prompt: &str,
user_prompt: &str,
tools: Vec<ToolDefinition>,
registry: Arc<ToolRegistry>,
max_steps: usize,
timeout_secs: u64,
event_tx: Option<Sender<SwarmEvent>>,
subtask_id: String,
bus: Option<Arc<AgentBus>>,
working_dir: Option<PathBuf>,
) -> Result<(String, usize, usize, AgentLoopExit)>