REMOTE-2111 (3/3): Wire the periodic checkpoint coordinator into AgentDriver - #14589
REMOTE-2111 (3/3): Wire the periodic checkpoint coordinator into AgentDriver#14589joeywangzr wants to merge 2 commits into
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR wires the periodic handoff checkpoint coordinator into AgentDriver behind the existing Oz handoff gate, the new off-by-default PeriodicHandoffCheckpoints flag, cloud task presence, and snapshot enablement. When active, end-of-run snapshot handling delegates to the coordinator's bounded finalize() path; otherwise the legacy one-shot upload path remains unchanged.
Concerns
- No blocking correctness, security, or spec-alignment concerns found in the reviewed diff.
spec_context.mdreports no approved or repository spec context for this PR, so there were no concrete spec commitments to enforce.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
2f4d085 to
e3bc04f
Compare
90db05c to
1461247
Compare
|
Pushed a follow-up commit to this branch from a review pass (1461247), and rebased onto the updated coordinator branch. Summary: Blocking — Now uses Blocking — the coordinator never got the declarations writer. Removed the Note on CI: this PR and #14573 have only ever run the OWNERS/CLA checks, because their bases aren't Two smaller things I left for you: |
e3bc04f to
f9880b7
Compare
1461247 to
f2ba2f2
Compare
Instantiates and drives CheckpointCoordinatorHandle from AgentDriver's own lifecycle, completing REMOTE-2111 Phase 3: - AgentDriverOptions gains checkpoint_interval (override for the default 5-minute-plus-jitter cadence; primarily for tests). - AgentDriver spawns a coordinator when a cloud task_id is present, snapshot uploads aren't disabled, and both FeatureFlag::OzHandoff and the new FeatureFlag::PeriodicHandoffCheckpoints are enabled. - Driver finalization routes through the coordinator's finalize() (bounded by the existing snapshot upload timeout) when a coordinator is active, instead of the legacy one-shot end-of-run snapshot path. - warp_features: add PeriodicHandoffCheckpoints, off by default while the coordinator rolls out. Co-Authored-By: Oz <oz-agent@warp.dev>
…ffolding Review follow-ups on the AgentDriver wiring. 1. Derive the finalize budget instead of passing `upload_timeout`. The coordinator's floor is `script_timeout + upload_timeout`, so passing `upload_timeout` alone made `remaining > floor` false for every possible configuration (defaults: 120s > 60s + 120s). Because this path `return`s past the legacy one-shot upload, enabling `PeriodicHandoffCheckpoints` meant no end-of-run snapshot at all: runs shorter than one checkpoint interval uploaded nothing, and longer runs lost everything since the last periodic tick. Use `checkpoint_coordinator::finalize_budget(script_timeout, upload_timeout)`, which owns the floor so the two cannot drift apart. 2. Give the coordinator the declarations writer. `run_snapshot_upload` flushes queued driver-side `file` appends before running the declarations script so none is in flight when the bash script starts appending to the same JSONL. The coordinator path skipped that, so checkpoints could miss the agent's most recent edits. The coordinator is gated on a superset of the writer's own conditions, so the handle is always present when the coordinator exists. 3. Remove the temporary `allow(dead_code)` scaffolding. Both earlier PRs in this stack noted their allows were "removable once that PR is merged on top of this one" — this is that PR. Removes the module-wide `#![allow(dead_code)]` in `checkpoint_coordinator` (which would otherwise permanently blind the lint over new async/networking code) plus the per-item allows in `snapshot` and `harness_support`, along with the now-stale comments explaining them. Verified with `cargo clippy -p warp --all-targets --tests -- -D warnings`. Co-Authored-By: Oz <oz-agent@warp.dev>
f2ba2f2 to
d9bb9b8
Compare
f9880b7 to
6735cd6
Compare

Part 3 of 3 in a stack splitting the periodic workspace-handoff checkpoint client work into reviewable chunks.
Stack
master)Stacked on #14573; only the diff vs. that branch is new in this PR. Please review against #14573's branch, not
master. This PR's tree, once the full stack is applied, is byte-identical to the original combined implementation fordriver.rs,mod.rs,terminal/view.rs, andwarp_features/lib.rs.What this does
Instantiates and drives
CheckpointCoordinatorHandlefromAgentDriver's own lifecycle, completing REMOTE-2111 Phase 3:AgentDriverOptionsgainscheckpoint_interval(override for the default 5-minute-plus-jitter cadence; primarily for tests).AgentDriverspawns a coordinator when a cloudtask_idis present, snapshot uploads aren't disabled, and bothFeatureFlag::OzHandoffand the newFeatureFlag::PeriodicHandoffCheckpointsare enabled.finalize()(bounded by the existing snapshot upload timeout) when a coordinator is active, instead of the legacy one-shot end-of-run snapshot path.warp_features: addPeriodicHandoffCheckpoints, off by default while the coordinator rolls out.Validation
cargo clippy --all-targets --tests -- -D warnings,cargo fmt --check, and the full checkpoint + coordinator test suites (19 + 13 tests respectively) all pass at the top of the stack. All#[allow(dead_code)]annotations added in #14588/#14573 are now provably unnecessary (clippy passes clean without any new warnings appearing once this PR's wiring makes everything reachable), confirming the split didn't drop any functionality.Co-Authored-By: Oz oz-agent@warp.dev