Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Turn diff attributes external Git updates to the agent #10348

Closedkyrylofranko(GitHub profile, opens in a new tab) opened this issue 2 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Open a clean Git repository in T3 Code.
  2. Complete one agent turn so T3 captures its checkpoint.
  3. Outside an active turn, update the repository with git pull --ff-only.
  4. Send another prompt that does not modify repository files.
  5. Wait for the turn to finish.

Expected behavior

The changed-files card only shows changes made during the active turn.

Git updates, branch switches, or other workspace changes made between turns must not appear as agent changes.

Actual behavior

The card includes every workspace change since the previous turn checkpoint.

In my case:

  • The previous checkpoint matched commit a7dc740.
  • A later git pull --ff-only moved master to e5496d7.
  • The pull included 133 commits.
  • The next agent turn did not modify repository files.
  • T3 displayed 830 changed files, with +134257 and -80745.

The displayed totals exactly match the Git difference between those two commits:

$ git diff --shortstat a7dc740..e5496d7
830 files changed, 134257 insertions(+), 80745 deletions(-)

The working tree remained clean:

$ git status --porcelain=v2 --branch
# branch.head master
# branch.upstream origin/master
# branch.ab +0 -0

This makes the card look like the agent changed 830 files during the turn.

Source hint

At turn start, ensurePreTurnBaselineFromTurnStart keeps the existing previous-turn checkpoint when that ref exists:

https://github.com/pingdotgg/t3code/blob/eb8ed80300bd719b49fc80ad8708f9839bb48c92/apps/server/src/orchestration/Layers/CheckpointReactor.ts#L428-L465

At turn completion, T3 compares that previous checkpoint with the new completion checkpoint:

https://github.com/pingdotgg/t3code/blob/eb8ed80300bd719b49fc80ad8708f9839bb48c92/apps/server/src/orchestration/Layers/CheckpointReactor.ts#L236-L273

As a result, workspace changes made between turns become part of the next turn diff.

Impact

Minor bug or occasional failure

Version or commit

0.0.39-nightly.20260906.1293

Environment

macOS 26.6.2, T3 Code desktop nightly, Codex with GPT-5.6 Sol.

Logs or stack traces

No runtime error appears.

Workaround

Start a new T3 thread after a pull or branch switch, or ignore the first changed-files card after an external update.

  1. I have a fix for this in #10197, targeting orchestration V2 (#2829). It captures a fresh baseline at turn start so changes made between turns aren’t attributed to the next reply. It doesn’t patch the legacy orchestration used by the reported nightly. Related: #4249.

  2. Note

    Grok responding on behalf of Julius.

    This is fixed by #17161, which just landed on main. A turn's changed files and diff now leave out files that Git brought in through pulls, merges, or rebases, so a turn after a git pull --ff-only that edits nothing shows no card instead of the full pull diff. Closing as completed; if you still see between-turn changes attributed to the agent on a build with #17161, please open a new issue with the repro.

  3. juliusmarminge closed this

Sign in to join this conversation.