pub enum LoopState {
Show 17 variants
Starting,
ContextAssembly,
ProviderProjection,
ModelStreaming,
StreamIntervention,
ToolPlanning,
Approval,
ToolDenied,
ToolExecution,
Interrupted,
WaitingForResume,
Compaction,
Continue,
Recovery,
Completed,
Cancelled,
Failed,
}Expand description
Names the finite phases of the SDK run loop. Use it in state tables, journal records, and tests to describe where a run is paused or executing; the enum is a marker only and side effects happen in the driver transition that enters the phase.
Variants§
Starting
The run has been accepted and initial package, policy, and registry checks are beginning.
ContextAssembly
The runtime is collecting context contributions before anything is shown to a provider.
ProviderProjection
Context has been admitted and is being projected into the provider-visible request shape.
ModelStreaming
A provider call is active and model deltas may be emitted.
StreamIntervention
Stream rules are inspecting, interrupting, or transforming an active model stream.
ToolPlanning
The runtime is interpreting provider output into candidate tool calls or loop actions.
Approval
A tool or extension action is waiting for an approval decision before execution.
ToolDenied
Policy or approval denied a requested tool before the executor was started.
ToolExecution
A journal-backed tool intent has been recorded and the configured executor may be running.
Interrupted
Cancellation, timeout, stream policy, or host intervention interrupted active work.
WaitingForResume
The run is suspended and requires a wake, resume signal, or durable replay input.
Compaction
The runtime is compacting context or summaries before continuing the loop.
Continue
The current iteration completed and the driver is preparing another loop iteration.
Recovery
Replay, repair, or reconciliation is resolving an incomplete or uncertain effect.
Completed
The run reached a successful terminal result.
Cancelled
The run reached a cancellation terminal result.
Failed
The run reached an unrecoverable failure terminal result.
Implementations§
Source§impl LoopState
impl LoopState
Sourcepub const ALL: [Self; 17]
pub const ALL: [Self; 17]
Constant value for the application::loop_state contract. Use it to keep SDK records and tests aligned on the same stable value.
Sourcepub fn all() -> &'static [Self]
pub fn all() -> &'static [Self]
Returns the all currently held by this value. This is state-table metadata only and does not advance a run or mutate loop state.
Sourcepub fn contract_name(self) -> &'static str
pub fn contract_name(self) -> &'static str
Returns the stable contract spelling for this loop state. This is a pure mapping used by fixtures and diagnostics; it does not advance the loop.
Sourcepub fn is_terminal(self) -> bool
pub fn is_terminal(self) -> bool
Reports whether this value is terminal. The check is pure and does not mutate SDK or host state.
Sourcepub fn can_carry_terminal_result(self) -> bool
pub fn can_carry_terminal_result(self) -> bool
Returns whether can carry terminal result applies for this state. This is state-table metadata only and does not advance a run or mutate loop state.
Sourcepub fn requires_cancel_transition(self) -> bool
pub fn requires_cancel_transition(self) -> bool
Returns whether requires cancel transition applies for this state. This is state-table metadata only and does not advance a run or mutate loop state.