pub struct AgentContinuation {
pub thread_id: ThreadId,
pub turn: usize,
pub total_usage: TokenUsage,
pub turn_usage: TokenUsage,
pub pending_tool_calls: Vec<PendingToolCallInfo>,
pub awaiting_index: usize,
pub completed_results: Vec<(String, ToolResult)>,
pub state: AgentState,
pub response_id: Option<String>,
pub stop_reason: Option<StopReason>,
pub response_content: Vec<ContentBlock>,
}Expand description
Continuation state that allows resuming the agent loop.
This contains all the internal state needed to continue execution after receiving a confirmation decision. Pass this back when resuming.
§Turn-summary fields
response_id and stop_reason capture the turn-closing LLM call
that produced AgentContinuation::pending_tool_calls before the
pause. They are carried across the pause boundary so the
TurnSummary emitted on the resume path can report the same LLM
metadata as the pre-pause summary for the same turn.
Both are Option and default to None for forward compatibility
with continuations persisted before these fields existed.
Fields§
§thread_id: ThreadIdThread ID (used for validation on resume)
turn: usizeCurrent turn number
total_usage: TokenUsageTotal token usage so far
turn_usage: TokenUsageToken usage for this specific turn (from the LLM call that generated tool calls)
pending_tool_calls: Vec<PendingToolCallInfo>All pending tool calls from this turn
awaiting_index: usizeIndex of the tool call awaiting confirmation
completed_results: Vec<(String, ToolResult)>Tool results already collected (for tools before the awaiting one)
state: AgentStateAgent state snapshot
response_id: Option<String>Provider response ID from the LLM call that produced this turn’s pending tool calls.
None for continuations persisted before this field was added,
or when the provider did not return an ID.
stop_reason: Option<StopReason>Stop reason from the LLM call that produced this turn’s pending tool calls.
None for continuations persisted before this field was added.
response_content: Vec<ContentBlock>Full content blocks from the LLM response that produced this turn’s pending tool calls (text, thinking, and tool-use blocks).
When the LLM emits text before tool calls (e.g. “I will run
that.” followed by a tool_use block), those text blocks must be
preserved so Phase 5 can reconstruct the complete assistant
message in the conversation history.
Empty for continuations persisted before this field was added.
Trait Implementations§
Source§impl Clone for AgentContinuation
impl Clone for AgentContinuation
Source§fn clone(&self) -> AgentContinuation
fn clone(&self) -> AgentContinuation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more