feat(agent): CheckpointV2 atomic resume and AgentErrorV1

Replace bare resume writes with temp/fsync/rename, mark legacy loads as manual_review, and expose bounded read-only retry decisions while keeping write auto-resume closed without a ledger.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-10-27 11:03:39 +08:00
1 parent 303c06f773
commit 5912164039
6 files changed
+618 -30

No files matched your search

+5 -6
View File
@@ -117,11 +117,10 @@ pub fn probe_capabilities(params: &Value) -> Value {
features.insert("view.document".into(), json!(0));
features.insert("view.reference_resolve".into(), json!(0));
}
// M-A0/M-A3: freeze protocol names. resource.view_v1 flips on when view feature ships
// the static ResourceView emitter; other agent bits stay 0 until their emitters land.
// M-A0/M-A1/M-A3: protocol capability bits. error/checkpoint open after emitters land.
features.insert("agent.error_v1".into(), json!(1));
features.insert("agent.checkpoint_v2".into(), json!(1));
for (k, v) in [
("agent.error_v1", 0),
("agent.checkpoint_v2", 0),
("agent.tool_schema_v1", 0),
("agent.output_channels_v1", 0),
("agent.context_pack_v2", 0),
@@ -248,8 +247,8 @@ mod tests {
assert_eq!(caps["features"]["runtime.event_stream"], 0);
assert_eq!(caps["features"]["runtime.cancel"], 0);
assert_eq!(caps["features"]["llm.messages"], 0);
assert_eq!(caps["features"]["agent.error_v1"], 0);
assert_eq!(caps["features"]["agent.checkpoint_v2"], 0);
assert_eq!(caps["features"]["agent.error_v1"], 1);
assert_eq!(caps["features"]["agent.checkpoint_v2"], 1);
assert_eq!(caps["features"]["agent.tool_schema_v1"], 0);
assert_eq!(caps["features"]["agent.output_channels_v1"], 0);
assert_eq!(caps["features"]["agent.context_pack_v2"], 0);