Prevent to many checkpoints gemini#71
Merged
peyton-alt merged 3 commits intofeat/gemini-cli-agentfrom Jan 20, 2026
Merged
Conversation
Entire-Checkpoint: de22551397e1
Entire-Checkpoint: d70360ee0899
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements checkpoint deduplication to prevent creating redundant commits when there are no actual changes. The implementation compares tree hashes between consecutive checkpoints and skips creating a new commit when the tree is identical, addressing the issue where Gemini testing resulted in too many checkpoints.
Changes:
- Added tree-based deduplication logic in
WriteTemporarythat compares the new tree hash with the previous checkpoint's tree hash - Introduced
WriteTemporaryResultstruct withSkippedflag to indicate when a checkpoint was deduplicated - Updated both manual-commit and auto-commit strategies to handle skipped checkpoints appropriately
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/checkpoint/checkpoint.go | Defines the new WriteTemporaryResult struct and updates the Store interface signature |
| cmd/entire/cli/checkpoint/temporary.go | Implements tree hash comparison logic for deduplication in WriteTemporary |
| cmd/entire/cli/checkpoint/checkpoint_test.go | Adds comprehensive test for deduplication behavior |
| cmd/entire/cli/strategy/manual_commit_git.go | Updates to handle skipped checkpoints and avoid incrementing checkpoint count |
| cmd/entire/cli/strategy/auto_commit.go | Adds commitCodeResult struct and logic to skip metadata commits when no code changes occur |
| cmd/entire/cli/strategy/auto_commit_test.go | Adds test verifying no metadata commit is created when there are no code changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Entire-Checkpoint: 881d5df3659e
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.
When testing gemini I noticed that after a simple prompt I got
"checkpoints_count": 5,I also noticed that there are multiple commits in the shadow branch. This now uses deduplication to prevent writing the same state multiple times but still makes sure different scenarios are handled when differing hooks fire.