Limit apply diff results to changed ranges#11987
Merged
Merged
Conversation
Restore changed-line-only apply-diff tool results by slicing accepted editor-buffer contents using the diff ranges already computed by CodeDiffView. This keeps remote apply diff support while avoiding full-file payloads when ranges are available. Co-Authored-By: Oz <oz-agent@warp.dev>
Contributor
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
Contributor
There was a problem hiding this comment.
Overview
This PR changes request-file-edits success results to build ranged UpdatedFileContext entries from accepted editor-buffer contents, with tests for ranged output and no-range fallback.
Concerns
- The ranged slicing path currently uses editor diff ranges as if they were 1-based file-context ranges, which can report line 0 and return the wrong content slice/context window.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
86b1b66 to
6584d1e
Compare
baae9d2 to
e8ce03b
Compare
kevinyang372
approved these changes
Jun 2, 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.
Description
This fixes the apply-diff/edit-file result payload regression where accepted file edits were reported back to the LLM as full post-edit file contents instead of only the changed ranges plus context.
Root cause: remote apply-diff support switched the result source to accepted editor-buffer contents, but the request-file-edits success path converted those buffers directly into
UpdatedFileContextentries withline_range: None. That bypassed the existing changed-line ranges computed byCodeDiffView, so the server received and rendered full files. The fix keeps the editor-buffer source needed for remote correctness, but slices it usingFileLocations.linesexpanded by the restored 10-line context window.Changes
UpdatedFileContextfragments from accepted editor-buffer content using changed ranges when available.Validation
rustup run 1.92.0 cargo fmt --manifest-path /workspace/warp/app/Cargo.toml --checkMACOSX_DEPLOYMENT_TARGET=10.14 rustup run 1.92.0 cargo test --manifest-path /workspace/warp/Cargo.toml -p warp updated_file_contexts_from_editor_buffersMACOSX_DEPLOYMENT_TARGET=10.14 rustup run 1.92.0 cargo clippy --manifest-path /workspace/warp/Cargo.toml -p warp --all-targets -- -D warningsCo-Authored-By: Oz oz-agent@warp.dev
Conversation: https://staging.warp.dev/conversation/2b2a0786-45a7-4d14-ac07-f300fa1aed27
Run: https://oz.staging.warp.dev/runs/019e81ed-8cc0-7ab3-a2d8-4734728412c9
This PR was generated with Oz.