Package com.tnsai.agents.interrupt
package com.tnsai.agents.interrupt
Agent interruption and checkpoint system.
This package provides interruption capabilities for agents, inspired by AgentScope's realtime steering feature. It allows:
- Graceful interruption of running agents
- State checkpointing and restoration
- Event-based interrupt handling
- Pause/resume functionality
Key Classes
InterruptibleAgent- Interface for interruptible agentsInterruptEvent- Sealed hierarchy of interrupt eventsAgentCheckpoint- Immutable snapshot of agent state
Interrupt Event Types
InterruptEvent.UserInterrupt- User-initiated (cancel, Ctrl+C)InterruptEvent.TimeoutInterrupt- Execution timeoutInterruptEvent.BudgetInterrupt- Token/cost limit exceededInterruptEvent.ErrorInterrupt- Recoverable errorInterruptEvent.ExternalInterrupt- External system signal
-
ClassDescriptionRepresents a checkpoint of agent state for interrupt/resume functionality.Builder for AgentCheckpoint.Sealed hierarchy of interrupt events for agent execution control.Budget interrupt when token/cost limits are hit.Error interrupt for recoverable errors.External system interrupt (e.g., shutdown signal, orchestrator command).Timeout interrupt when execution exceeds time limit.User-initiated interrupt (e.g., cancel button, Ctrl+C).Interface for agents that support graceful interruption and state preservation.