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

Method complete

core/src/agent_api/run_lifecycle.rs:28–59  ·  view source on GitHub ↗
(&self, result: std::result::Result<AgentResult, E>)

Source from the content-addressed store, hash-verified

26
27impl StreamRunWorkerState {
28 pub(super) async fn complete<E>(&self, result: std::result::Result<AgentResult, E>)
29 where
30 E: std::fmt::Display,
31 {
32 match result {
33 Ok(result) => {
34 if let Some(persistence) = &self.persistence {
35 persistence.record_result(&result);
36 self.should_auto_save
37 .store(true, std::sync::atomic::Ordering::Release);
38 }
39 }
40 Err(error) => {
41 let cancelled = self
42 .cancel_token
43 .lock()
44 .await
45 .as_ref()
46 .map(|t| t.is_cancelled())
47 .unwrap_or(false);
48 if cancelled {
49 let _ = self.run_store.mark_cancelled(&self.run_id).await;
50 } else {
51 let error_message = error.to_string();
52 let _ = self
53 .run_store
54 .mark_failed(&self.run_id, error_message)
55 .await;
56 }
57 }
58 }
59 }
60}
61
62#[derive(Clone)]

Callers 10

detect_with_llmMethod · 0.45
compact_messagesFunction · 0.45
execute_with_promptMethod · 0.45
spawn_with_promptMethod · 0.45
spawn_from_messagesMethod · 0.45
call_llmMethod · 0.45

Calls 10

record_resultMethod · 0.80
storeMethod · 0.80
mark_cancelledMethod · 0.80
mark_failedMethod · 0.80
was_cancelledMethod · 0.80
clear_cancel_tokenMethod · 0.80
clear_loop_checkpointMethod · 0.80
run_idMethod · 0.80
auto_save_if_enabledMethod · 0.80
finishMethod · 0.45