Cancel a pending confirmation
(&self, tool_id: &str)
| 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 { |