Skip to main content

ResumableState

Struct ResumableState 

Source
pub struct ResumableState {
Show 34 fields pub agent_id: AgentId, pub run_id: Option<RunId>, pub session_id: Option<SessionId>, pub parent_run_id: Option<RunId>, pub parent_task_id: Option<TaskId>, pub conversation_id: Option<ConversationId>, pub message_history: Vec<ModelMessage>, pub pending_tool_returns: Vec<ToolReturnPart>, pub subagent_history: BTreeMap<String, Vec<ModelMessage>>, pub user_prompts: Option<Vec<ContentPart>>, pub previous_assistant_response_reference: Option<String>, pub steering_messages: Vec<String>, pub handoff_message: Option<String>, pub shell_env: BTreeMap<String, String>, pub deferred_tool_metadata: BTreeMap<String, Metadata>, pub agent_registry: BTreeMap<String, AgentInfo>, pub approval_required_tools: Vec<String>, pub approval_required_mcp_servers: Vec<String>, pub security: SecurityConfig, pub auto_load_files: Vec<String>, pub tasks: BTreeMap<String, Value>, pub notes: BTreeMap<String, String>, pub tool_search_loaded_tools: Vec<String>, pub tool_search_loaded_namespaces: Vec<String>, pub usage: Usage, pub usage_snapshot_entries: BTreeMap<String, UsageSnapshotEntry>, pub model_config: ModelConfig, pub tool_config: ToolConfig, pub started_at: DateTime<Utc>, pub state: StateStore, pub message_bus: MessageBus, pub trace_snapshot: TraceContext, pub metadata: Metadata, pub extra: BTreeMap<String, Value>,
}
Expand description

Serializable state used to restore an agent context.

Fields§

§agent_id: AgentId

Agent identifier.

§run_id: Option<RunId>

Current run identifier when exported.

§session_id: Option<SessionId>

Stable logical session affinity identifier.

§parent_run_id: Option<RunId>

Parent run identifier when this state belongs to a delegated child run.

§parent_task_id: Option<TaskId>

Parent-scoped delegated task identifier when this state belongs to a lightweight task.

§conversation_id: Option<ConversationId>

Conversation identifier.

§message_history: Vec<ModelMessage>

Canonical message history.

§pending_tool_returns: Vec<ToolReturnPart>

Tool returns to inject at the start of the next run.

§subagent_history: BTreeMap<String, Vec<ModelMessage>>

Serialized subagent history, keyed by agent id.

§user_prompts: Option<Vec<ContentPart>>

User prompt content collected for the current run.

§previous_assistant_response_reference: Option<String>

Visible assistant response immediately before the current user prompt.

§steering_messages: Vec<String>

Accumulated user steering messages for compact restore.

§handoff_message: Option<String>

Rendered handoff message.

§shell_env: BTreeMap<String, String>

Legacy shell environment accepted on restore but never emitted by current exports.

§deferred_tool_metadata: BTreeMap<String, Metadata>

Metadata for deferred tool calls.

§agent_registry: BTreeMap<String, AgentInfo>

Serialized agent registry.

§approval_required_tools: Vec<String>

Legacy agent-owned approval selector accepted for wire compatibility but never applied.

§approval_required_mcp_servers: Vec<String>

Legacy MCP approval selector accepted for wire compatibility but never applied.

§security: SecurityConfig

Security-related runtime configuration.

§auto_load_files: Vec<String>

File paths to mention for on-demand inspection on the next request.

The legacy field name is retained for serialized-state compatibility.

§tasks: BTreeMap<String, Value>

Serialized tasks from the typed task manager, keyed by task id.

§notes: BTreeMap<String, String>

Persisted notes, keyed by note id.

§tool_search_loaded_tools: Vec<String>

Tool names loaded through tool search.

§tool_search_loaded_namespaces: Vec<String>

Namespace IDs loaded through tool search.

§usage: Usage

Accumulated usage. Starweaver extension.

§usage_snapshot_entries: BTreeMap<String, UsageSnapshotEntry>

Per-run cumulative usage ledger entries keyed by stable source id.

§model_config: ModelConfig

Model/runtime configuration used for injected runtime context and tool policies.

§tool_config: ToolConfig

Tool-level configuration used by first-party and host tools.

§started_at: DateTime<Utc>

Context creation time used for elapsed runtime context.

§state: StateStore

State domains. Starweaver extension.

§message_bus: MessageBus

Pending bus messages. Starweaver extension.

§trace_snapshot: TraceContext

Trace correlation snapshot. Starweaver extension.

§metadata: Metadata

Run metadata. Starweaver extension.

§extra: BTreeMap<String, Value>

Host extension data preserved across state export and restore.

Trait Implementations§

Source§

impl Clone for ResumableState

Source§

fn clone(&self) -> ResumableState

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 Debug for ResumableState

Source§

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

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

impl Default for ResumableState

Source§

fn default() -> ResumableState

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ResumableState

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 ResumableState

Source§

impl PartialEq for ResumableState

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for ResumableState

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 ResumableState

Source§

impl VersionedRecord for ResumableState

Source§

const SCHEMA: &'static str = "starweaver.context.resumable_state"

Stable schema identifier.
Source§

const ALLOW_BARE_V0: bool = true

Whether this record explicitly accepts a previous bare-JSON v0 shape.
Source§

const VERSION: u32 = 1

Current schema version.
Source§

fn decode_version( version: u32, payload: Value, ) -> Result<Self, VersionedRecordError>
where Self: DeserializeOwned,

Decode one enveloped payload version. Read more
Source§

fn decode_bare_v0(payload: Value) -> Result<Self, VersionedRecordError>
where Self: DeserializeOwned,

Decode the explicitly supported bare-JSON v0 shape. Read more

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more