pingdotgg / pingdotgg/t3code

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

Open
#10,348 1 comment 0 reactions 0 assignees View on GitHub

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

  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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.