(
&self,
state: &ExecutionLoopState,
response: &LlmResponse,
final_text: &str,
event_tx: &Option<mpsc::Sender<AgentEvent>>,
emit_end: bool,
)
| 87 | } |
| 88 | |
| 89 | async fn emit_end_if_requested( |
| 90 | &self, |
| 91 | state: &ExecutionLoopState, |
| 92 | response: &LlmResponse, |
| 93 | final_text: &str, |
| 94 | event_tx: &Option<mpsc::Sender<AgentEvent>>, |
| 95 | emit_end: bool, |
| 96 | ) { |
| 97 | if !emit_end { |
| 98 | return; |
| 99 | } |
| 100 | |
| 101 | if let Some(tx) = event_tx { |
| 102 | let verification_summary = |
| 103 | VerificationSummary::from_reports(&state.verification_reports); |
| 104 | tx.send(AgentEvent::End { |
| 105 | text: final_text.to_string(), |
| 106 | usage: state.total_usage.clone(), |
| 107 | verification_summary: Box::new(verification_summary), |
| 108 | meta: response.meta.clone(), |
| 109 | }) |
| 110 | .await |
| 111 | .ok(); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | /// Notify providers of turn completion for memory extraction. |
| 116 | async fn notify_turn_complete(&self, session_id: &str, prompt: &str, response: &str) { |
no test coverage detected