Truncate oversized git diffs instead of failing#1499
Merged
juliusmarminge merged 3 commits intomainfrom Mar 29, 2026
Merged
Conversation
- Add bounded output handling for staged and range git context - Cover oversized checkpoint and commit-context diffs with tests
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
- remove checkpoint diff output truncation - update live test to expect the full diff output
Chrono-byte
pushed a commit
to Chrono-byte/t3code
that referenced
this pull request
Mar 31, 2026
hapwi
pushed a commit
to hapwi/hapcode
that referenced
this pull request
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[truncated]marker instead of failing.Testing
bun fmtbun lintbun typecheckbun run testNote
Medium Risk
Changes
GitCore.executebehavior to optionally return truncated stdout/stderr (with a[truncated]marker) rather than erroring when output exceeds limits, which could affect downstream consumers that assume full diffs/patches.Overview
Adds opt-in output truncation to
GitCorecommand execution viatruncateOutputAtMaxBytes, capping collected stdout/stderr and appending a\n\n[truncated]marker instead of throwing whenmaxOutputBytesis exceeded.Applies per-call byte limits with truncation enabled for
prepareCommitContextstaged patches andreadRangeContextcommit/diff summaries and patches, while leaving checkpoint diffs untruncated.Adds integration tests to verify oversized staged/range patches are truncated (and marked) and that
CheckpointStore.diffCheckpointsstill returns a full large diff without truncation.Written by Cursor Bugbot for commit 1b1872c. This will update automatically on new commits. Configure here.
Note
Truncate oversized git diffs instead of failing in
GitCorecollectOutputin GitCore.ts gains atruncateOutputAtMaxBytesoption; when enabled, output is capped and suffixed with[truncated]instead of throwing aGitCommandError.prepareCommitContextandreadRangeContextnow use per-field byte limits (49 KB for staged patches, 19–59 KB for range diff fields) with truncation enabled.[truncated]rather than errors.Macroscope summarized 1b1872c.