Add KV-backed agent context checkpoints#252
Open
FabioMalpezzi wants to merge 8 commits into
Open
Conversation
8cc6264 to
c23c702
Compare
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.
This adds an explicit context tool for ds4-agent checkpoints and restores, backed by persisted KV state.
The scope is intentionally narrow: let the agent save a known-good model state, restore it later, and report what happened in a form that can be tested.
Included:
agent_context checkpoint,restore,list,show, anddrop.bashpath withgit status --shortandgit diff.The self-improvement e2e is deliberately a controlled temporary-repository test. It proves the loop shape: inspect, edit, test, diff, checkpoint, restore, retest, and record evidence. It does not claim that DS4 found and optimized DS4 itself. The docs call out the stronger follow-up: a DS4-on-DS4 optimization loop that selects a small measurable improvement, implements it, runs the relevant benchmark/e2e check, and records whether the metric improved.
This PR is independent from #250. It does not add or link the native Git tool implementation. If #250 lands first, the adaptive e2e can exercise native Git inspection; otherwise it keeps working with the current bash-based path.
Tests run after rebasing on current
origin/main:make testmake test-agent-context-compact-canarymake test-kv-cache-benefitmake test-agent-context-self-improvementKV benefit sample from this run: