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

Method was_cancelled

core/src/agent_api/runtime_events.rs:192–199  ·  view source on GitHub ↗

Returns `true` when the per-run cancellation token (or any parent it was derived from, such as the session-level token) has been fired. Used by lifecycle `complete()` to classify a failed run as `Cancelled` vs `Failed` when an `Err` comes back from the agent loop.

(&self)

Source from the content-addressed store, hash-verified

190 /// Used by lifecycle `complete()` to classify a failed run as `Cancelled`
191 /// vs `Failed` when an `Err` comes back from the agent loop.
192 pub(super) async fn was_cancelled(&self) -> bool {
193 self.cancel_token
194 .lock()
195 .await
196 .as_ref()
197 .map(|t| t.is_cancelled())
198 .unwrap_or(false)
199 }
200
201 pub(super) async fn finish(&self) {
202 self.active_tools.write().await.clear();

Callers 1

completeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected