Skip to content

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

Done

Description

@LHagfoss

Problem

A turn's footer chip showed Changes +19218 −15581 for a turn whose own edits were 3 files, +77 −22 (made in a separate worktree, #4300).

The numbers match exactly what the turn's git pull --ff-only brought into the active checkout at the start (AGENTS.md asks for this pull at the start of every task):

$ git diff --shortstat a1f170f29 3c95e265d
 141 files changed, 19218 insertions(+), 15581 deletions(-)

The chip reads the turn's checkpoint diff (apps/desktop/src/ui/TurnChanges.tsx:39, turnDiff → _rustcode/checkpoints/diff), which compares the whole working tree before and after the turn. Anything that moves HEAD (pull, checkout, merge, switching branches) shows up as the agent's changes. Rewind to before this turn would presumably also try to undo the pull.

Expected

The chip shows what the agent changed, not what git moved in. Options:

  • Leave out changes that came from HEAD moving: diff against the new HEAD plus the turn's own edits, or exclude files whose content matches the new HEAD.
  • At minimum, when HEAD moved during the turn, say so on the chip (e.g. "Pulled 12 commits") instead of folding it into the edit count.
  • Make sure Rewind does not roll back a fast-forward pull silently.

Acceptance criteria

  • A turn that runs only git pull --ff-only shows no Changes chip, or one that says the branch moved, not +N −M edits.
  • A turn that pulls and then edits 3 files shows those 3 files.
  • A test covers a checkpoint pair where HEAD advanced between them.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions