pub struct Checkpoint {
pub thread_id: String,
pub checkpoint_id: String,
pub state: State,
pub step: usize,
pub pending_nodes: Vec<String>,
pub metadata: HashMap<String, Value>,
pub created_at: DateTime<Utc>,
pub cleared_interrupt: Option<String>,
pub attempts: HashMap<String, u32>,
pub child_ledger: HashMap<String, Value>,
}Expand description
Checkpoint data structure for persistence
Fields§
§thread_id: StringThread identifier
checkpoint_id: StringUnique checkpoint ID
state: StateState at this checkpoint
step: usizeStep number
pending_nodes: Vec<String>Nodes pending execution
metadata: HashMap<String, Value>Additional metadata
created_at: DateTime<Utc>Creation timestamp
cleared_interrupt: Option<String>The node whose static interrupt produced this checkpoint.
A static interrupt is raised before the node runs, so the checkpoint holds a frontier that still contains it. Without this marker the resumed run reaches the same conclusion and raises the same interrupt, and the node never executes. The executor clears the marker once that node has run, so a cycle returning to the same gate asks again.
attempts: HashMap<String, u32>How many times each node has been attempted, for retry policies.
Held here so a retry budget survives a resume. adk-python does not persist its attempt count, so a resumed node there starts its budget again.
child_ledger: HashMap<String, Value>Outputs of children invoked imperatively from a node body, keyed by child path.
A resumed parent re-runs from the top, so without this every child would run again. Only successful outputs are recorded: a failed or interrupted child must re-run.
Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn new(
thread_id: &str,
state: State,
step: usize,
pending_nodes: Vec<String>,
) -> Self
pub fn new( thread_id: &str, state: State, step: usize, pending_nodes: Vec<String>, ) -> Self
Create a new checkpoint
Sourcepub fn with_cleared_interrupt(self, node: impl Into<String>) -> Self
pub fn with_cleared_interrupt(self, node: impl Into<String>) -> Self
Record the node whose static interrupt produced this checkpoint.
Sourcepub fn with_metadata(self, key: &str, value: Value) -> Self
pub fn with_metadata(self, key: &str, value: Value) -> Self
Add metadata to the checkpoint
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§fn clone(&self) -> Checkpoint
fn clone(&self) -> Checkpoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more