pub fn finalize_agent_tool( messages: &[Value], agent_id: &str, agent_type: &str, start_time_ms: u64, ) -> Result<AgentToolResult, String>
Finalize an agent run and produce a result.