You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Summary
The Diff panel truncates any branch or working-tree diff larger than ~117 KB, showing "This diff was truncated because it exceeded the preview limit. The changes shown are incomplete."
The cap is REVIEW_DIFF_PATCH_MAX_OUTPUT_BYTES = 120_000 (apps/server/src/vcs/GitVcsDriverCore.ts:48), applied to the whole patch at :2196 and :2231. Untracked files get REVIEW_UNTRACKED_DIFF_MAX_OUTPUT_BYTES = 80_000 (:49, used at :2145).
120 KB is far out of line with every other diff budget in the codebase, on the same transport:
A single expanded file is allowed 8x more than the entire diff it belongs to, and a remote PR diff — which crosses the network before it crosses the WebSocket — is allowed 70x more.
There is no config or env knob for any of these (nothing in apps/server/src/config.ts or apps/server/src/cli/config.ts).
Steps to reproduce
In any git repo, produce a branch diff over ~120 KB of patch text. A lockfile update or a dependency bump alone is usually enough.
Open the Diff panel on that thread, scope "Branch changes" (or "Working tree").
The truncation banner appears and later files are missing from the patch.
Expected behavior
The Diff panel shows the complete diff, or at minimum applies a budget consistent with the rest of the codebase.
Actual behavior
The patch is byte-sliced at 120 KB by collectOutput (GitVcsDriverCore.ts:622-698), with "\n\n[truncated]" appended. Two consequences:
The cut lands mid-line, mid-hunk (:669-673), so the tail of the patch can also fail to parse cleanly.
Truncation is order-dependent, not size-dependent. Because it is one budget for the whole patch, a large early file (a lockfile, a generated bundle) consumes it before git emits later files, so real source changes disappear entirely rather than appearing truncated. PR Support per-file review diff truncation #3945 made this same argument.
Some context on the value, since there is no rationale recorded anywhere for it:
It was introduced on main by T3 Code Mobile [WIP] #2013 (T3 Code Mobile [WIP], +55,249/−6,840), together with getReviewDiffPreview and the mobile review sheet. The PR body describes the Expo client and the client-runtime move; every comment on it is from a bot, and Macroscope's read is "Needs human review / 7 blocking correctness issues / diff too large".
It has not been changed by any merged PR since.
The whole ReviewService pipeline was built for the mobile review sheet, which parses and highlights the patch natively on a phone over a possibly-cellular connection. The web and desktop Diff panel consumes the same RPC and inherits that budget.
Two adjacent things worth folding in, if you want them here rather than as separate issues:
getReviewDiffPreview always returns both sources (working-tree and branch-range, :2259-2286) while the UI renders only one (DiffPanel.tsx:437-440). Half of every payload is discarded.
Checkpoint diffs truncate silently.GitVcsDriver.ts:862-873 passes maxOutputBytes but not appendTruncationMarker, VcsProcess.ts:122-124 hardcodes truncatedMarker: "", and :884 drops stdoutTruncated. ThreadTurnDiff has no truncated field, so an oversized turn diff renders as a silently incomplete patch — the truncated flag that Truncate oversized git diffs instead of failing #1499 introduced never reaches the UI on that path.
Before submitting
Area
apps/server
Summary
The Diff panel truncates any branch or working-tree diff larger than ~117 KB, showing "This diff was truncated because it exceeded the preview limit. The changes shown are incomplete."
The cap is
REVIEW_DIFF_PATCH_MAX_OUTPUT_BYTES = 120_000(apps/server/src/vcs/GitVcsDriverCore.ts:48), applied to the whole patch at:2196and:2231. Untracked files getREVIEW_UNTRACKED_DIFF_MAX_OUTPUT_BYTES = 80_000(:49, used at:2145).120 KB is far out of line with every other diff budget in the codebase, on the same transport:
REVIEW_DIFF_PATCH_MAX_OUTPUT_BYTESREVIEW_DIFF_FILE_MAX_OUTPUT_BYTESGitVcsDriverCore.ts:50DEFAULT_MAX_OUTPUT_BYTES:42CHECKPOINT_DIFF_MAX_OUTPUT_BYTESGitVcsDriver.ts:324DIFF_MAX_OUTPUT_BYTESpullRequest/GitHubPullRequestCli.ts:256A single expanded file is allowed 8x more than the entire diff it belongs to, and a remote PR diff — which crosses the network before it crosses the WebSocket — is allowed 70x more.
There is no config or env knob for any of these (nothing in
apps/server/src/config.tsorapps/server/src/cli/config.ts).Steps to reproduce
Expected behavior
The Diff panel shows the complete diff, or at minimum applies a budget consistent with the rest of the codebase.
Actual behavior
The patch is byte-sliced at 120 KB by
collectOutput(GitVcsDriverCore.ts:622-698), with"\n\n[truncated]"appended. Two consequences::669-673), so the tail of the patch can also fail to parse cleanly.Impact
Major degradation or frequent failure
Version or commit
main @ 3b5d476
Additional notes
Some context on the value, since there is no rationale recorded anywhere for it:
mainby T3 Code Mobile [WIP] #2013 (T3 Code Mobile [WIP], +55,249/−6,840), together withgetReviewDiffPreviewand the mobile review sheet. The PR body describes the Expo client and theclient-runtimemove; every comment on it is from a bot, and Macroscope's read is "Needs human review / 7 blocking correctness issues / diff too large".ReviewServicepipeline was built for the mobile review sheet, which parses and highlights the patch natively on a phone over a possibly-cellular connection. The web and desktop Diff panel consumes the same RPC and inherits that budget.Two adjacent things worth folding in, if you want them here rather than as separate issues:
getReviewDiffPreviewalways returns both sources (working-treeandbranch-range,:2259-2286) while the UI renders only one (DiffPanel.tsx:437-440). Half of every payload is discarded.GitVcsDriver.ts:862-873passesmaxOutputBytesbut notappendTruncationMarker,VcsProcess.ts:122-124hardcodestruncatedMarker: "", and:884dropsstdoutTruncated.ThreadTurnDiffhas notruncatedfield, so an oversized turn diff renders as a silently incomplete patch — thetruncatedflag that Truncate oversized git diffs instead of failing #1499 introduced never reaches the UI on that path.