Skip to main content

LoopState

Enum LoopState 

Source
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

Source

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.

Source

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.

Source

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.

Source

pub fn is_terminal(self) -> bool

Reports whether this value is terminal. The check is pure and does not mutate SDK or host state.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for LoopState

Source§

fn clone(&self) -> LoopState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LoopState

Source§

impl Debug for LoopState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for LoopState

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for LoopState

Source§

impl Hash for LoopState

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for LoopState

Source§

fn cmp(&self, other: &LoopState) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for LoopState

Source§

fn eq(&self, other: &LoopState) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for LoopState

Source§

fn partial_cmp(&self, other: &LoopState) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for LoopState

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for LoopState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.