pub struct LoopSuspendContext {
pub loop_id: String,
pub loop_name: String,
pub turn: u32,
}Expand description
Mid-loop checkpoint context attached to EngineEvent::Suspended when a
suspension fires inside a loop block’s per-turn dispatch (a skill task
invoked as a loop tool whose on_validation_exhausted / on unable
handler routes to a checkpoint).
This metadata travels alongside the regular SuspendTrigger: the trigger
describes why the engine paused (DagPosition / ValidationExhausted /
AgentUnable / AgentVariant), and LoopSuspendContext tells consumers
which loop turn the suspension belongs to so resumption can be
rendered in the loop’s UI lane and so the spawn handler’s persisted
envelope carries enough context to reconstruct the loop’s identity if the
execution is later restarted (driver state versioning is a follow-up; the
current cycle relies on the in-process await-point to hold the loop’s
stack).
Serialized as a flat object ({loop_id, loop_name, turn}) on the wire.
#[serde(default)] on the field on EngineEvent::Suspended keeps
wire-compat with older servers / SDKs that don’t emit it (they
deserialize as None — a non-loop suspension).
Fields§
§loop_id: StringUUID v4 generated when the loop driver started; stable for the
lifetime of one loop NAME(...) invocation. Used by the spawn
handler / Studio to correlate LoopStart → Suspended → Resumed
→ subsequent LoopTurn events into the same per-loop UI lane.
loop_name: StringThe declared loop NAME(...) identifier. Same value as
EngineEvent::LoopStart::name / EngineEvent::LoopTurn::name.
turn: u321-indexed turn the suspension occurred during. Matches the next
EngineEvent::LoopTurn::turn the engine will emit when the
suspension resumes and the turn settles.
Trait Implementations§
Source§impl Clone for LoopSuspendContext
impl Clone for LoopSuspendContext
Source§fn clone(&self) -> LoopSuspendContext
fn clone(&self) -> LoopSuspendContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoopSuspendContext
impl Debug for LoopSuspendContext
Source§impl<'de> Deserialize<'de> for LoopSuspendContext
impl<'de> Deserialize<'de> for LoopSuspendContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for LoopSuspendContext
impl PartialEq for LoopSuspendContext
Source§fn eq(&self, other: &LoopSuspendContext) -> bool
fn eq(&self, other: &LoopSuspendContext) -> bool
self and other values to be equal, and is used by ==.