[Bug]: Turn diff attributes external Git updates to the agent #10348
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#
- Open a clean Git repository in T3 Code.
- Complete one agent turn so T3 captures its checkpoint.
- Outside an active turn, update the repository with
git pull --ff-only. - Send another prompt that does not modify repository files.
- 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-onlymovedmastertoe5496d7. - The pull included 133 commits.
- The next agent turn did not modify repository files.
- T3 displayed
830 changed files, with+134257and-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:
At turn completion, T3 compares that previous checkpoint with the new completion checkpoint:
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.
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-onlythat 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.juliusmarminge closed this
Sign in to join this conversation.
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.