Skip to content

Prevent to many checkpoints gemini#71

Merged
peyton-alt merged 3 commits intofeat/gemini-cli-agentfrom
soph/prevent-to-many-checkpoints-gemini
Jan 20, 2026
Merged

Prevent to many checkpoints gemini#71
peyton-alt merged 3 commits intofeat/gemini-cli-agentfrom
soph/prevent-to-many-checkpoints-gemini

Conversation

@Soph
Copy link
Collaborator

@Soph Soph commented Jan 20, 2026

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.

Soph added 2 commits January 20, 2026 17:10
Entire-Checkpoint: d70360ee0899
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 WriteTemporary that compares the new tree hash with the previous checkpoint's tree hash
  • Introduced WriteTemporaryResult struct with Skipped flag 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
@peyton-alt peyton-alt merged commit 151ed71 into feat/gemini-cli-agent Jan 20, 2026
3 checks passed
@peyton-alt peyton-alt deleted the soph/prevent-to-many-checkpoints-gemini branch January 20, 2026 19:17
Copy link
Contributor

@peyton-alt peyton-alt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants