Skip to content

fix(engine): leave a pull out of a turn's checkpoint changes - #4308

Merged
LHagfoss merged 1 commit into
mainfrom
fix/engine-checkpoint-diff-head-moves
Nov 24, 2026
Merged

LHagfoss merged 1 commit into
mainfrom
fix/engine-checkpoint-diff-head-moves

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

A turn's checkpoint diff compared the whole work tree before and after the turn, so a git pull --ff-only at the start of a turn showed up as the agent's edits (+19218 −15581 for a 3-file turn).

Each checkpoint commit's parent is the HEAD it was taken on. When the two ends of a turn stand on different heads, a file is left out of the turn's changes if it changed between the heads and matches its HEAD at both ends (it was not edited). A file the pull brought in and the turn then edited still shows. This applies to the list counts (the chip), the per-file diff, and Rewind, which now keeps what the pull brought in instead of silently rolling it back.

Changelog

The Changes chip under a turn no longer counts a git pull, checkout or merge as the agent's edits, and Rewind keeps what it pulled in.

Testing

cargo fmt --check, comment and size lints locally; a_pull_during_the_turn_is_not_the_turns_change covers a pull-only turn (no changes), a pull plus edits (only the edited files), and a rewind that keeps the pulled files. Compilation and tests run in CI.

Closes #4301

Files that changed only because HEAD moved during the turn (a pull, checkout or merge) are no longer counted in the Changes chip, listed in the turn diff, or rolled back by Rewind.
@github-actions github-actions Bot added the fix A bug fix label Nov 24, 2026
@LHagfoss
LHagfoss merged commit 1cd97e8 into main Nov 24, 2026
7 checks passed
@LHagfoss
LHagfoss deleted the fix/engine-checkpoint-diff-head-moves branch November 24, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turn Changes chip counts a git pull as the agent's edits

2 participants