Render apply_patch as an edit tool#315419
Draft
roblourens wants to merge 1 commit intomainfrom
Draft
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves Copilot CLI tool rendering and file-edit tracking in the agent host by treating apply_patch / git_apply_patch as first-class edit tools (with edit-style messaging) and extracting affected file paths from patch payloads so edits can be tracked across multiple files.
Changes:
- Add explicit invocation/past-tense display strings and tool-input rendering for
apply_patch/git_apply_patch. - Extract affected file paths from apply-patch and git-diff patch text and use them to drive
FileEditTrackerlifecycle for patch tools. - Add focused unit coverage for patch display and affected-file extraction.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/copilotToolDisplay.test.ts | Adds tests for patch tool display strings and affected-file extraction. |
| src/vs/platform/agentHost/node/copilot/mapSessionEvents.ts | Hardens tool-argument JSON parsing (only accepts plain objects). |
| src/vs/platform/agentHost/node/copilot/copilotToolDisplay.ts | Implements patch-tool messaging, tool input selection, and patch path extraction helpers. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Tracks multiple edited files per tool call and hardens argument parsing. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 1
Comment on lines
+237
to
+240
| const gitDiffMatch = line.match(/^diff --git a\/(?<before>.+) b\/(?<after>.+)$/); | ||
| if (gitDiffMatch?.groups) { | ||
| addPath(gitDiffMatch.groups.after); | ||
| continue; |
Contributor
blocks-ci screenshots changedReplace the contents of Updated blocks-ci-screenshots.md<!-- auto-generated by CI — do not edit manually -->
#### editor/codeEditor/CodeEditor/Dark

#### editor/codeEditor/CodeEditor/Light

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Dark

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Light

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Dark

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Light
 |
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
Validation