MCPcopy Create free account
hub / github.com/AI45Lab/Code / emit_end_if_requested

Method emit_end_if_requested

core/src/agent/completion_runtime.rs:89–113  ·  view source on GitHub ↗
(
        &self,
        state: &ExecutionLoopState,
        response: &LlmResponse,
        final_text: &str,
        event_tx: &Option<mpsc::Sender<AgentEvent>>,
        emit_end: bool,
    )

Source from the content-addressed store, hash-verified

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) {

Callers 1

Calls 2

sendMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected