Repository navigation
fix(server): review diffs no longer read oversized untracked files - #36302
Conversation
Review previews put every untracked file into the temporary review index, so git read all of their bytes; only the status totals had a size budget. The preview now uses the same 256 MiB budget. Files that do not fit stay out of the index, smallest files are kept first, and the source is reported the way an unlistable untracked tree already is: no file list, marked truncated, with the bounded patch of everything that did fit. Staged deletions are dropped before sizes are counted, so their worktree copies cannot spend the budget. Co-authored-by: luis-7654 <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Review previews now exclude untracked files beyond the existing byte budget and explicitly flag partial results. The change limits expensive reads using a temporary index without modifying repository contents. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
No code change this round; the head is unchanged. The brief listed nothing to change, so I watched pull request 36302 until its checks and review bots settled: all 35 checks passed on 3123830, Macroscope approved with no line findings, and CodeRabbit generated no actionable comments (merge risk minimal). The pull request reports mergeable_state clean. CodeRabbit's description check notes that the description's Evidence section is still a placeholder; that is the proof step's to fill in. The change itself is as before: getReviewDiffPreview now applies the 256 MiB untracked budget that only status totals used. Staged deletions are dropped before sizes are counted, files are admitted smallest first, and a preview with omitted files is reported through the existing incomplete-source state (no file list, truncated, bounded patch of what fit). Status totals stay all-or-nothing.
Supersedes #32463. The change is @luis-7654's; their commits are kept.
Reproduction on main
Proposed steps, not executed: 1. Create a disposable Git repository with an initial commit. 2. Modify a tracked text file, create a small untracked ordinary.txt, and create an untracked sparse file with
truncate -s 8G large.dataon Linux. 3. Add the repository as a T3 Code project, create a thread, and open Changes or Uncommitted. 4. On main, background totals are bounded, but the full review request still introduces large.data into its temporary index before reading statistics and can stall. With this change, large.data is omitted, ordinary edits remain reviewable, and the review displays an omission notice.Evidence
Create an initially committed repository, modify tracked.txt, add small ordinary.txt and an 8 GiB sparse large.data, create a replay-backed thread, and open Changes. Both runs used fresh synthetic state, Chromium, 1280×800, and the light theme.
Scenario source. Base error details containing the workspace path are masked. The runner returned exit 0: failed on base, passed on head.
Not shown:
Tests
None run locally this round, since nothing changed. CI on 3123830: all 35 checks passed, including the 8 required ones (Test Server shards, Lint, Build and Typecheck).
Not in this change
untrackedOmittedcontract field and the new omission notices in web DiffPanel and mobile ReviewSheet/reviewModel/useReviewDiffData: new visible wording that is not a certain bug fix; the existing incomplete-preview state covers it.untrackedOmittedcontract field and web/mobile omission notices remain left out, as in the previous round.Who did the work
Run by the t3code factory in T3 Code.