pub struct RunState {
pub run_id: RunId,
pub session_id: Option<SessionId>,
pub messages: Vec<ChatMessage>,
pub usage: TokenUsage,
pub steps_used: u32,
pub pending: Vec<PendingCall>,
pub recent_calls: Vec<u64>,
}Expand description
Everything needed to continue a paused run, in serializable form.
Store it as JSON (a database row, a tracked job result), show
RunState::awaiting to a person, then pass it to Agent::resume
with their decisions. The system prompt is not part of the state: the
resuming agent rebuilds it.
Fields§
§run_id: RunIdThe paused run’s id. The resumed run keeps it.
session_id: Option<SessionId>The session the run belongs to, if any.
messages: Vec<ChatMessage>The transcript so far, ending with the assistant’s tool calls.
usage: TokenUsageProvider-reported tokens spent so far.
steps_used: u32Tool-execution rounds used so far, the paused round included.
pending: Vec<PendingCall>The calls of the paused round.
recent_calls: Vec<u64>Loop-guard fingerprints, so a resumed run keeps its loop history.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunState
impl<'de> Deserialize<'de> for RunState
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for RunState
Auto Trait Implementations§
impl Forget for RunState
impl Freeze for RunState
impl RefUnwindSafe for RunState
impl Send for RunState
impl Sync for RunState
impl Unpin for RunState
impl UnsafeUnpin for RunState
impl UnwindSafe for RunState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> JsonSink for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
Open a deferred
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.