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

Method cancel_all

core/src/hitl.rs:408–425  ·  view source on GitHub ↗

Cancel all pending confirmations

(&self)

Source from the content-addressed store, hash-verified

406
407 /// Cancel all pending confirmations
408 pub async fn cancel_all(&self) -> usize {
409 let pending_list: Vec<_> = {
410 let mut pending_map = self.pending.write().await;
411 pending_map.drain().collect()
412 };
413
414 let count = pending_list.len();
415
416 for (_, confirmation) in pending_list {
417 let response = ConfirmationResponse {
418 approved: false,
419 reason: Some("Confirmation cancelled".to_string()),
420 };
421 let _ = confirmation.response_tx.send(response);
422 }
423
424 count
425 }
426}
427
428// Implement ConfirmationProvider trait for ConfirmationManager

Callers 3

test_cancel_allFunction · 0.45
cancel_confirmationsMethod · 0.45
closeMethod · 0.45

Calls 3

writeMethod · 0.80
lenMethod · 0.45
sendMethod · 0.45

Tested by 1

test_cancel_allFunction · 0.36