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

Method publish_run_cancelled

core/src/ahp/executor.rs:543–564  ·  view source on GitHub ↗

Publish an explicit run cancellation lifecycle event.

(
        &self,
        run_id: &str,
        session_id: &str,
        reason: Option<&str>,
    )

Source from the content-addressed store, hash-verified

541
542 /// Publish an explicit run cancellation lifecycle event.
543 pub async fn publish_run_cancelled(
544 &self,
545 run_id: &str,
546 session_id: &str,
547 reason: Option<&str>,
548 ) {
549 self.record_event();
550 self.runtime_state.clear_runtime_actions();
551 let mut event =
552 crate::ahp::cancelled_run_event(run_id, session_id, &self.agent_id, self.depth, reason);
553 event.context = self.build_context();
554
555 if self.batch_enabled {
556 self.add_to_batch(event).await;
557 self.flush_batch().await;
558 return;
559 }
560
561 if let Err(e) = self.client.send_event_full(&event).await {
562 warn!("AHP run cancellation event failed: {}", e);
563 }
564 }
565
566 /// Start background tasks for heartbeat and idle detection.
567 ///

Calls 6

cancelled_run_eventFunction · 0.85
clear_runtime_actionsMethod · 0.80
build_contextMethod · 0.80
add_to_batchMethod · 0.80
flush_batchMethod · 0.80
record_eventMethod · 0.45