[Bug]: Turn diff attributes external Git updates to the agent
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/server/src/orchestration/Layers/CheckpointReactor.ts, reading ensurePreTurnBaselineFromTurnStart around lines 428-465 and the completion comparison around lines 236-273. Reproduce the clean-repository pull or branch-switch scenario, then verify that external workspace changes are excluded from the next turn's changed-files card while files changed during the active turn remain included.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100