vv-agent 0.6.2

VectorVein agent runtime, SDK, CLI, tools, and workspace backends
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::sync::Arc;

use crate::runtime::state::StateStore;
use crate::types::{CycleRecord, Message, Metadata};

pub(super) fn checkpoint_snapshot(
    state_store: &Arc<dyn StateStore>,
    task_id: &str,
) -> (Vec<Message>, Vec<CycleRecord>, Metadata) {
    match state_store.load_checkpoint(task_id) {
        Ok(Some(checkpoint)) => (
            checkpoint.messages,
            checkpoint.cycles,
            checkpoint.shared_state,
        ),
        Ok(None) | Err(_) => (Vec::new(), Vec::new(), Metadata::new()),
    }
}