Return the changed region from edit/write/delete/apply_patch - #575
Merged
TheGreatAxios merged 3 commits intoAug 23, 2026
Merged
Conversation
Surfaces the diff verify-plugin already computes when checking a write landed, instead of discarding it. Bounded to a char cap so a whole-file rewrite can't blow the result size.
- truncate() now reserves the truncation note's length within maxChars instead of appending after slicing, so the result never exceeds the cap. - delete_file skips reading file content into memory above 256KB and reports a byte-count summary instead, so deleting a large file no longer buffers it just to produce a diff. - toHunks()/formatHunk() now follow unified-diff convention for a zero-length side (start is one less than the adjacent line, not the line itself). - Loosened delete-file-plugin.test.ts assertions to check the parts that matter instead of the exact (previously wrong) hunk header text. - Documented that write_file gains a real extra pre-write read to source the diff's "before" content, while edit_file's read is reused. - Noted in apply-patch-diff.test.ts that the Update File case stubs around a known read_file defect (CL-6966) and is not proof that path works in production.
TheGreatAxios
enabled auto-merge
August 23, 2026 20:37
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.
Closes CL-6962.
Summary
-0,0, not-1,0).Test plan
bunx tsc --noEmitbun test src/plugins/change-diff.test.ts— small edit diff, whole-file rewrite truncation (cap enforced exactly), boundary truncation at several small caps, large-file summary, deletion, unchanged-content no-op, correct hunk headersbun test src/plugins/verify-plugin.test.ts— edit_file and write_file results carry the diff, including new-file creationbun test src/plugins/delete-file-plugin.test.ts— delete result carries removed contentbun test src/agent/apply-patch-diff.test.ts— Add/Update/Delete ops each surface their diff (Update is stubbed around a known read_file defect filed as CL-6966; not proof that path works in production, noted in the test)bun test src/plugins src/agent src/subagent— full local sweep, 1158 pass