pub enum RunState {
Idle,
PreparingContext,
StreamingModel,
PlanningToolCalls,
EvaluatingPolicy,
WaitingApproval,
ExecutingTool,
CommittingTurn,
Completed,
Cancelled,
Interrupted,
Failed,
}Expand description
Explicit lifecycle state of one kernel run.
Variants§
Idle
No operation has started.
PreparingContext
Durable session context is being loaded and frozen.
StreamingModel
One immutable model request is being streamed.
PlanningToolCalls
Complete model tool calls are being committed and validated.
EvaluatingPolicy
A validated invocation is being evaluated by policy.
WaitingApproval
The run is durably paused for a caller decision.
ExecutingTool
One authorized tool is executing.
CommittingTurn
Durable turn output and checkpoint are being committed.
Completed
The run completed normally.
Cancelled
The run was cooperatively cancelled.
Interrupted
The run was interrupted at a recoverable boundary.
Failed
The run failed before a safe continuation boundary.
Implementations§
Source§impl RunState
impl RunState
Sourcepub fn transition(self, next: Self) -> Result<Self, StateTransitionError>
pub fn transition(self, next: Self) -> Result<Self, StateTransitionError>
Validates and applies one explicit transition.
§Errors
Returns an error when the target is not legal from this state.
Sourcepub const fn is_terminal(self) -> bool
pub const fn is_terminal(self) -> bool
Returns whether this state is terminal for the current invocation.