* Remove Ask User Question tool in favor of Core tool
Fixes https://github.com/microsoft/vscode/issues/296134
* feedback
* remove duplicate & restore toolset
* feedback
* revert change in anthropic.ts because ask_questions is what is used in Claude
* Add support for local repository memory and update telemetry events
* Update memory command labels for clarity in the UI
* update test
* Add repository memory section to snapshot tests for clarity
* Initial plan
* Fix non-existent files incorrectly treated as external
- Add file existence check in isFileExternalAndNeedsConfirmation()
- Non-existent files now return false (not external) to prevent confirmation dialog
- Actual tool invocation will fail with proper "file not found" error
- Update tests to reflect new behavior
Co-authored-by: connor4312 <2230985+connor4312@users.noreply.github.com>
* Address code review feedback
- Add comprehensive comment explaining error handling tradeoff
- Add test suite with MockFileSystemService to verify existing external files still need confirmation
- Tests confirm the fix works correctly for both existing and non-existing files
Co-authored-by: connor4312 <2230985+connor4312@users.noreply.github.com>
* update
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: connor4312 <2230985+connor4312@users.noreply.github.com>
Co-authored-by: Connor Peet <connor@peet.io>
* Add skill name to readFileToolInvoked telemetry
* Rename telemetry field to nameField
---------
Co-authored-by: Harald Kirschner <digitarald@gmail.com>
* update memory tool to context
* Update memory paths to include '/memories/' prefix and remove unsupported repo path tests
* update memory guidelines and user instructions with conditional rendering based on memory tool availability
* remove memory tool from agent prompts snapshot
* remove memory tool from agent prompts snapshot
* Add support for Anthropic memory tool functionality and related checks
* Enhance memory path validation with normalization and root check functions
* Update error message for missing memory path in view command
* Add MemoryCleanupService to manage stale memory files and integrate with MemoryTool
* tools: avoid putting fences into file reads by default
We've seen the model get confused here. Looking at vendor tools from Gemini and Codex CLIs, they don't add explicit line number messages like we do (which was motivation behind having the fences there in the first place. So let's try removing them. Controllable with EXP for sanity checking.
* tests and comments
* Add chat.additionalReadAccessPaths setting for read-only access to external folders
Implements a new setting that allows users to specify folders outside the
workspace that Copilot Chat read-only tools (read_file, list_dir) can
access without requiring confirmation.
- Add github.copilot.chat.additionalReadAccessPaths setting (string array)
- Gate additional access behind a readOnly flag on assertFileOkForTool,
isFileExternalAndNeedsConfirmation, and isDirExternalAndNeedsConfirmation
- Edit tools remain workspace-restricted (isFileOkForTool does not pass readOnly)
- .copilotignore rules are still respected for additional paths
Closesmicrosoft/vscode#293386
* Addresses PR feedback
* prompts: add vitest unit tests for PromptPathRepresentationService
Adds comprehensive unit test coverage for PromptPathRepresentationService
with 26 tests covering both PromptPathRepresentationService and
TestPromptPathRepresentationService:
- getFilePath() tests for file/vscode-remote/other schemes
- resolveFilePath() tests for posix/windows paths and URI parsing
- Windows-specific path handling (drive letters, UNC paths, backslashes)
- Workspace folder integration for drive letter rectification
- getExampleFilePath() tests for platform-specific output
- Round-trip conversion tests
Windows drive-letter tests are skipped on non-Windows platforms since
hasDriveLetter() uses the real OS, not the service override.
Fixes https://github.com/microsoft/vscode/issues/292422
(Commit message generated by Copilot)
* fix compile
* tests again
* fix test
Adds support for the 'vscode-chat-response-resource' scheme when checking
if a file is external and needs confirmation. This scheme is used for
chat response resources and should be treated similarly to untitled files
that don't require external file confirmation.
- Extends isFileExternalAndNeedsConfirmation to recognize the
vscode-chat-response-resource scheme
- Allows chat response resources to be accessed without confirmation
dialogs
Fixes https://github.com/microsoft/vscode/issues/292733
(Commit message generated by Copilot)
* added experimental search model toggling
* configure tool call limit
* update to make model configurable, default to chat endpoint
* add model name and tool call limit exp variables
* fix merge conflict comma bug
* update default values so tests pass
* update to have try/catch if modelName not available
* Implement GitHub Copilot Memory service integration and enhance memory management features
* Enhance Copilot Memory integration: add configuration option, refactor memory service methods, and streamline memory fetching logic
* revert changes to context management
* move setting to a preview location and update tags for preview
* Refactor Copilot Memory configuration: rename setting to CopilotMemoryEnabled and update related method
* add warnings for repo memory operations when Copilot Memory is enabled, and introduce RepoMemoryInstructionsPrompt for better user guidance.
* Add memory tool integration: define memory parameters, implement memory storage, and enhance prompts for user guidance
* Refactor code structure for improved readability and maintainability
* Add memory tool to available tools and update new chat condition in AgentPrompt
* Update memory tool display names and descriptions for improved clarity
* Refactor AgentMemoryService: remove session management and related code for improved clarity and focus on repository memory handling
* Remove deduplicateMemories function and related tests for code simplification
* Remove memory tool from available tools in package.json
* Refactor memory tool and context prompt: remove unused code and simplify memory fetching logic
* Update tool instructions and available tools list in snapshots for improved clarity
* Refactor memory tool tests: simplify memory parameters and update mock services for improved clarity
* tools: remove explanation field from MultiReplaceStringTool
Removes the optional 'explanation' field from the multiReplaceString tool
input parameters. This simplifies the tool interface and aligns with the
latest tool design patterns.
- Removes 'explanation' from package.json tool definition
- Removes 'explanation' from IMultiReplaceStringToolParams interface
- Updates multiReplaceStringTool to use IAbstractReplaceStringInput directly
Fixes https://github.com/microsoft/vscode/issues/289907
(Commit message generated by Copilot)
* fix ci
* tools: add confirmation logic to CreateDirectoryTool
Adds user confirmation dialog to the CreateDirectoryTool via the standard
edit confirmation infrastructure. This ensures users are explicitly asked
before a directory is created.
- Makes prepareInvocation async to support confirmation dialog
- Integrates createEditConfirmation for consistent UX with other edit tools
- Displays directory path in a fenced code block for clarity
- Adds IInstantiationService dependency injection
(Commit message generated by Copilot)
* Update src/extension/tools/node/createDirectoryTool.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Improves file edit confirmation notifications by skipping diff display
when the only difference between old and new content is whitespace. This
prevents showing overly large diffs (e.g., >2500 lines) when the actual
changes are minimal or non-existent, making it clearer to users what
changes the agent is making.
- Adds early return in formatDiffAsUnified when content is identical
after trimming whitespace
- Displays a brief 'contents are identical' message instead of a large
diff
Fixes https://github.com/microsoft/vscode/issues/288781
(Commit message generated by Copilot)
* tools: add support for model-specific tool registration
This PR goes with https://github.com/microsoft/vscode/pull/287666
This allows the registration of tools that are scoped to specific
language models. These tools can be registered at runtime with
definitions derived from e.g. the server.
I think we should adopt this and go away from the current
`alternativeDefinitions` pattern which we have used previously.
Example of having tools specific for GPT 4.1 vs 4o:
```ts
ToolRegistry.registerModelSpecificTool(
{
name: 'gpt41_get_time',
inputSchema: {},
description: 'Get the current date and time (4.1)',
displayName: 'Get Time (GPT 4.1)',
toolReferenceName: 'get_time',
source: undefined,
tags: [],
models: [{ id: 'gpt-4.1' }],
},
class implements ICopilotTool<unknown> {
invoke() {
return new vscode.LanguageModelToolResult([new vscode.LanguageModelTextPart('Current year is 2041 (GPT 4.1)')]);
}
}
);
ToolRegistry.registerModelSpecificTool(
{
name: 'gpt4o_get_time',
inputSchema: {},
description: 'Get the current date and time (4o)',
displayName: 'Get Time (GPT 4o)',
toolReferenceName: 'get_time',
source: undefined,
tags: [],
models: [{ id: 'gpt-4o' }],
},
class implements ICopilotTool<unknown> {
invoke() {
return new vscode.LanguageModelToolResult([new vscode.LanguageModelTextPart('Current year is 2040 (GPT 4o)')]);
}
}
);
```
* demo
* fix
* overrides
* add overridesTool
* fix inverted logic
* test fixes and back compat
* make memory tool model specific
* fix tests and contribute memory to the vscode toolset
* verison
* fix unit tests
* rm config
* fix missing askquestions
---------
Co-authored-by: bhavyaus <bhavyau@microsoft.com>
Adds support for file deletion in the apply_patch tool by introducing
new VS Code API types for workspace-level file edits. The apply_patch
tool now properly reports deleted files through the new workspaceEdit()
response stream method.
- Introduces ChatWorkspaceFileEdit interface to represent file-level
operations (create, delete, rename) with optional oldResource and
newResource properties
- Adds ChatResponseWorkspaceEditPart class for workspace edits containing
file-level operations
- Updates ExtendedChatResponsePart type to include the new workspace edit
part type
- Adds workspaceEdit() method to ChatResponseStream for reporting
file-level edits
- Modifies applyPatchTool to track deleted files in a separate set and
report them through the new workspaceEdit() method
- Removes subagentInvocationId from ChatToolInvocationData base interface
and moves it to optional streamData parameter in beginToolInvocation()
- Changes chatStreamToolCallId from readonly to mutable in
LanguageModelToolInvocationOptions to allow modifications
Fixes https://github.com/microsoft/vscode/issues/275705
(Commit message generated by Copilot)
* search subagent tool added
* cleaning up description of search subagent
* additional changes
* update linting issue
* Exit early on search subagent call
* search subagent tool added
* cleaning up description of search subagent
* additional changes
* update linting issue
* Add fixes for subagent
* describe read file tool in its prompt
* fixing copilot cli issues?
* resolve merge conflicts with main
* explicit any pt 2
* update explicit any to unknown
* demo
* updating prompt to include description
* fixing newline bug
* added correct input params for subagent
* update to add final turn warning injection
* code snippet hydration
* adding details to toolMetadata (untested)
* commented out until testing
* remove exit from main PR
* actuallly terminate loop
* end loop after round is added and run
* remove early exit handling
* add experiment flags
* update code to check for exp + auto mode
* update to only use gpt 5 mini for search subagent
* Update src/extension/prompts/node/agent/searchSubagentPrompt.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update docs/tools.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update package.nls.json
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* update tests to handle new prompts
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* deleting vestigial file
* fix merge conflict
* update to default to using the main agent model as fallback for subagent, rather than hardcoding gpt4.1
* remove extra whitespace
* remove runSubagent from package.json and update prompt for final snippet clarity
* reset default to false
* add clearer injection prompt
* updating to work with main branch changes
* rewrite search subagent to have its own tool calling loop file + ensure no nested loops with codebase
* remove copilot-added search subagent doc
* update toolResultMessage
* handle exp configuration for search subagent in the right place
* use searchSubagentLoop instead of subagentLoop
* update to be in line with main
* remove CCA agents
* Some minor cleanup
* Update import for ChatToolInvocationPart in SearchSubagentTool
* Replace inSubAgent flag with subAgentInvocationId for tool calling loop checks
---------
Co-authored-by: Anisha Agarwal <anishaagarwal@Anishas-MacBook-Pro.local>
Co-authored-by: Vritant Bhardwaj <vrtoku@gmail.com>
Co-authored-by: root <root@perflens-vm7.e4rbrboag42enkzhvodo1frcqh.xx.internal.cloudapp.net>
Co-authored-by: Anisha Agarwal <anishaagarwal@MacBookPro.hsd1.ma.comcast.net>
Co-authored-by: Zhichao Li <zhichli@microsoft.com>
Co-authored-by: vritant24 <vritoku@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: bhavyaus <bhavyau@microsoft.com>
* Start work on handling tool calls as they stream in
* Explore partial tool streaming
* consume new proposal
* Match main PR
* Better partial json handling
* Plumb through tool call id to invoke
* Hack internal ids to be the stream id
* Add suppot for a few more stream handlers
* Accumulate args
* Show lines instead of characters
* Fix tests
* Leave debug string commented
* Feedback