feat: add delete file tool and related functionality#4180
Closed
mossgowild wants to merge 3 commits intomicrosoft:mainfrom
Closed
feat: add delete file tool and related functionality#4180mossgowild wants to merge 3 commits intomicrosoft:mainfrom
mossgowild wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Author
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a delete_files tool to the Copilot agent's toolkit, enabling the AI to delete files from the workspace. It is intended as a companion to the existing apply_patch tool, enabled only when apply_patch is not available (for models that don't support it). The implementation follows the pattern established by other file-manipulation tools (createFile, insertEdit, applyPatch).
Changes:
- New
DeleteFilesToolclass withinvoke,prepareInvocation,handleToolStream, andresolveInputimplementations. - Tool registration in
ToolName/ContributedToolNameenums,toolCategories,allTools.ts,package.json, andpackage.nls.json. - Conditional tool enablement in
getAgentTools: enabled only whenApplyPatchis disabled.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/extension/tools/node/deleteFilesTool.tsx |
New tool implementation that deletes files via workspaceEdit stream and returns EditFileResult TSX |
src/extension/tools/node/allTools.ts |
Side-effect import to register the new tool and docTool |
src/extension/tools/common/toolNames.ts |
Adds DeleteFiles to ToolName/ContributedToolName enums and toolCategories map |
src/extension/intents/node/agentIntent.ts |
Enables DeleteFiles only when ApplyPatch is disabled |
package.nls.json |
Localizable strings for the new tool's name and description |
package.json |
Tool schema declaration and addition to the editFiles group |
e60be58 to
00fcc11
Compare
00fcc11 to
26c8b4a
Compare
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.
This PR adds the delete file tool and related functionality.
Closes microsoft/vscode#295943
Changes