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

Method cancel

core/src/hitl.rs:389–405  ·  view source on GitHub ↗

Cancel a pending confirmation

(&self, tool_id: &str)

Source from the content-addressed store, hash-verified

387
388 /// Cancel a pending confirmation
389 pub async fn cancel(&self, tool_id: &str) -> bool {
390 let pending = {
391 let mut pending_map = self.pending.write().await;
392 pending_map.remove(tool_id)
393 };
394
395 if let Some(confirmation) = pending {
396 let response = ConfirmationResponse {
397 approved: false,
398 reason: Some("Confirmation cancelled".to_string()),
399 };
400 let _ = confirmation.response_tx.send(response);
401 true
402 } else {
403 false
404 }
405 }
406
407 /// Cancel all pending confirmations
408 pub async fn cancel_all(&self) -> usize {

Callers 2

test_cancel_confirmationFunction · 0.45
test_cancel_nonexistentFunction · 0.45

Calls 3

writeMethod · 0.80
removeMethod · 0.80
sendMethod · 0.45

Tested by 2

test_cancel_confirmationFunction · 0.36
test_cancel_nonexistentFunction · 0.36