Skip to content

Commit 0b6d126

Browse files
joeywangzroz-agent
andcommitted
Add periodic checkpoint coordinator state machine
Adds the Idle -> Due -> InFlight -> Idle scheduling loop (with Finalizing -> Stopped reachable from any state) that will drive periodic workspace-handoff checkpoints, per REMOTE-2111 Phase 3. - checkpoint_coordinator.rs: CheckpointCoordinatorHandle spawns the loop and exposes finalize() for graceful shutdown. The timer only ever moves Idle to Due; Due polls a safe-boundary predicate (conversation not mid-turn) before entering InFlight, which runs exactly one attempt via snapshot::run_checkpoint_from_declarations_file on a background task so a racing finalize() can bound how long it waits without ever stranding the attempt. finalize() starts at most one more attempt (skipped below the gather/upload timeout floor) or awaits an already-in-flight one -- never both -- bounded end to end by its budget. - terminal/view.rs: add TerminalView::ai_action_model(), which is_safe_boundary uses to check for unfinished actions on the conversation. This module has no production caller yet -- AgentDriver wires CheckpointCoordinatorHandle::new into its spawn/finalize lifecycle in a follow-up, stacked PR -- so it is marked allow(dead_code) at the module level with a comment explaining why; removable once that PR merges on top of this one. Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent b88ff25 commit 0b6d126

4 files changed

Lines changed: 1064 additions & 0 deletions

File tree

app/src/ai/agent_sdk/driver.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ use crate::terminal::view::ConversationRestorationInNewPaneType;
9999
pub(crate) mod attachments;
100100
#[cfg(feature = "local_fs")]
101101
pub(crate) mod cache_setup;
102+
mod checkpoint_coordinator;
102103
pub(crate) mod cloud_provider;
103104
pub(crate) mod environment;
104105
mod error_classification;

0 commit comments

Comments
 (0)