Skip to main content

Module interrupt

Module interrupt 

Source
Expand description

Centralized interrupt/cancellation token for a single agent run.

One token is created per user query execution. All components (LLM caller, tool executor, HTTP client, etc.) share the same token so that a single ESC press reliably cancels the entire operation.

Uses tokio_util::sync::CancellationToken under the hood for true async-safe cancellation, plus an AtomicBool for synchronous polling.

Ported from opendev/core/runtime/interrupt_token.py.

Structsยง

InterruptToken
Async-safe cancellation token shared across all components of a run.
InterruptedError
Error raised when an operation is interrupted by the user.