MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / handle_cancel

Method handle_cancel

crates/chat-cli/src/cli/chat/cli/knowledge.rs:468–480  ·  view source on GitHub ↗

Handle cancel operation

(os: &Os, session: &ChatSession, operation_id: Option<&str>)

Source from the content-addressed store, hash-verified

466
467 /// Handle cancel operation
468 async fn handle_cancel(os: &Os, session: &ChatSession, operation_id: Option<&str>) -> OperationResult {
469 let agent = Self::get_agent(session);
470 let async_knowledge_store = match KnowledgeStore::get_async_instance(os, agent).await {
471 Ok(store) => store,
472 Err(e) => return OperationResult::Error(format!("Error accessing knowledge base directory: {}", e)),
473 };
474 let mut store = async_knowledge_store.lock().await;
475
476 match store.cancel_operation(operation_id).await {
477 Ok(result) => OperationResult::Success(result),
478 Err(e) => OperationResult::Error(format!("Failed to cancel operation: {}", e)),
479 }
480 }
481
482 /// Validate and sanitize path
483 fn validate_and_sanitize_path(os: &Os, path: &str) -> Result<String, String> {

Callers

nothing calls this directly

Calls 2

ErrorEnum · 0.50
cancel_operationMethod · 0.45

Tested by

no test coverage detected