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

Method cancel

core/src/run.rs:443–462  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

441 }
442
443 pub async fn cancel(&self) -> bool {
444 let current_run_id = self.current_run_id.lock().await.clone();
445 if current_run_id.as_deref() != Some(self.id.as_str()) {
446 return false;
447 }
448
449 let token = self.cancel_token.lock().await.clone();
450 if let Some(token) = token {
451 token.cancel();
452 let _ = self.store.mark_cancelled(&self.id).await;
453 if let Some(executor) = &self.hook_executor {
454 executor
455 .record_run_cancelled(&self.id, &self.session_id, Some("cancelled by host"))
456 .await;
457 }
458 true
459 } else {
460 false
461 }
462 }
463}
464
465fn apply_event_to_snapshot(run: &mut RunSnapshot, event: &AgentEvent) {

Calls 4

mark_cancelledMethod · 0.80
cloneMethod · 0.45
as_strMethod · 0.45
record_run_cancelledMethod · 0.45