Repository navigation
feat(runtime): Phase G RestorePoint capture and restore - #736
Merged
Merged
Conversation
Phase G1: matching agentkit-1 sessions capture and restore RestorePoint snapshots (empty tape/plugin_states). Tape snapshots and cross-version checkpoints still reject before mutation.
Phase G2: same-epoch lost-ack returns the original event without rewriting session state. A retry after restore opens a new epoch fails CAS. Drop event epoch promotion SQL.
Capture writes run_id/revision/epoch/commit_ref into RestorePoint extra. Restore checks that stamp against live operation state before mutation.
JSON-plain frozen operation state values so HTTP capture can save. Seed a new turn's CAS at the current projection epoch after restore.
Duplicate event_id lost-acks no longer rewrite mailbox. Restore then the same event_id fails CAS instead of promoting projection_epoch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase G1–G3 for new-runtime sessions: RestorePoint checkpoints replace the Phase F blanket 409.
agentkit-1sessions can capture/restore RestorePoints (checkpoint_format=agentkit-1, empty tape/plugin_states).OperationStateVersion(run_id/revision/projection_epoch/commit_ref). Restore checks that stamp before mutation.EventRecord.projection_epochis immutable; same-epoch lost-ack returns the original; post-restore retries fail CAS.POST /checkpoints200, restore 200, third turn completed. Frozen operation-state values are JSON-plained; a new turn after restore seeds CAS at the current projection epoch.new_sessions_enabledstays off.Tests
uv run pytest tests/coding_agent/test_phase_g_restore_point.py tests/coding_agent/test_phase_g_epoch.py tests/coding_agent/test_runtime_checkpoint_capture_service.py tests/coding_agent/test_phase_f_checkpoint_rejection.py tests/coding_agent/test_phase_f_serving.py tests/agentkit/checkpoint/test_service.pyagentkit-1(flag flipped only in local sqlite, then set back to 0)Out of scope