Commit Graph

214 Commits

Author SHA1 Message Date
Bhavya U cb59a60b0c Implement GitHub Copilot Memory service integration (#3236)
* 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
2026-01-29 05:46:37 +00:00
Harald Kirschner dac3d77abc Add agent-customization skill with primitives documentation (#3196)
* Add agent-customization skill with primitives documentation

* Update assets/prompts/skills/agent-customization/primitives/workspace-instructions.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: rename agentCustomizationSkill setting to follow Advanced naming convention

* Updated skills.md based on spec

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-27 18:53:43 +00:00
Martin Aeschlimann b51d1a0f23 Use instruction index files to do file access checks (#3179)
* init

* update

* add skill folder check

* Update src/platform/customInstructions/common/customInstructionsService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/extension/tools/node/toolUtils.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/platform/test/common/testCustomInstructionsService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/platform/customInstructions/common/customInstructionsService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/platform/test/common/testCustomInstructionsService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-26 20:58:19 +00:00
Connor Peet d93ad2aa0d tools: page large mcp output to a readable disk file (#3140)
* tools: page large mcp output to a readable disk file

* Update src/extension/prompts/node/panel/toolCalling.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix test

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-23 23:44:45 +00:00
Connor Peet 35a05059a4 tools: remove explanation field from MultiReplaceStringTool (#3129)
* 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
2026-01-23 19:11:57 +00:00
Bhavya U 3284f7a6f3 implement agent memory service and integrate with memory tool for repo memory (#3109)
* implement agent memory service and integrate with memory tool for repo memory

* fix(tools): correct tool name retrieval in invokeTool method

* Update src/extension/tools/node/memoryTool.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor(tests): update memory tool tests to use 'repo' path instead of 'workspace'

* fix(tools): rename memory tool to 'copilot_memory' and update tool invocation logic

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-23 15:24:23 +00:00
Connor Peet 9861b33352 tools: add confirmation logic to CreateDirectoryTool (#3091)
* 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>
2026-01-22 23:31:40 +00:00
SteVen Batten e716a77b4c Support reading files outside of the current workspace (#3052)
* support reading files outside of the current workspace

* address comment
2026-01-22 23:20:18 +00:00
Connor Peet 03b29b7830 tools: skip diff display when content is identical after trim (#3088)
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)
2026-01-22 23:16:09 +00:00
Connor Peet 05ef58cb16 tools: add confirmations for notebook edits (#3068)
* tools: add confirmations for notebook edits

* fix
2026-01-22 18:53:40 +00:00
Connor Peet ba56721dfa tools: add support for model-specific tool registration (#2857)
* 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>
2026-01-22 18:34:05 +00:00
Bhavya U 8402a9b177 update TodoList context to use sessionResource instead of sessionId (#3024) 2026-01-21 02:16:26 +00:00
Paul 339297e789 Handle extension-contributed skills for skill read UX (#3020)
* fix

* Update src/platform/customInstructions/common/customInstructionsService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* PR

* fix

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-21 02:13:29 +00:00
Connor Peet 2b4e4592d6 tools: support delete file operations in apply_patch tool (#3023)
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)
2026-01-21 00:49:18 +00:00
Logan Ramos f57e195009 Don't display invalid file URIs (#3015) 2026-01-20 20:38:27 +00:00
Johannes Rieken 367dc5fdbf feat: enhance edit confirmation by adding allowed edit URIs (#2975)
* feat: enhance edit confirmation by adding allowed edit URIs

re https://github.com/microsoft/vscode/issues/274770

* Update src/extension/agents/copilotcli/node/permissionHelpers.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-19 17:08:10 +00:00
Bhavya U 7bac1dc38f refactor: remove unused IConfigurationService from TodoListContextPrompt (#2964) 2026-01-19 07:45:05 +00:00
Paul 6183985f6d Adopt latest provider pattern for org/enterprise custom agents (#2737)
* PR

* activation

* fix test

* wip

* update

* tests

* Update src/platform/github/common/githubService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/extension/agents/vscode-node/organizationInstructionsProvider.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/platform/github/common/octoKitServiceImpl.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* update

* update setting name

* wip

* fix

* use enum

* PR

* nit

* add polling

* tests

* cleanup

* use helper

* remove instructions

* clean

* use custom source

* update

* update

* test updates

* fix tests

* update types

* PR

* use proposed API

* Update src/platform/customInstructions/common/customInstructionsService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix tests

* update for skills

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-16 02:46:47 +00:00
Anisha Agarwal 0af20a790c Search Subagent support (#2736)
* 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>
2026-01-15 05:59:57 +00:00
Connor Peet 27f68cda6d edits: show stream progress in edit tools (#2863)
* edits: show stream progress in edit tools

* flush markdown before starting a tool call
2026-01-15 01:50:13 +00:00
Paul 447f836019 Custom chat render for agent skills (#2756)
* load

* updates

* update

* PR

* PR

* test

* fix test

* PR
2026-01-14 22:29:19 +00:00
Logan Ramos 78046bd098 Handle partial tool streaming (#2165)
* 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
2026-01-14 18:27:52 +00:00
Don Jayamanne 0b364a7194 Update canExistingFileBeEdited to support notebooks (#2657) 2025-12-23 03:34:39 +00:00
Rob Lourens 962bd05695 Fix "todoList is required for write operation" error in prompt (#2654)
Fix #276175
2025-12-21 00:46:19 +00:00
Rob Lourens baafb7f6fd Adopt async interactive.transferActiveChat (#2653)
* Adopt async interactive.transferActiveChat
See microsoft/vscode#283512

* Fix type
2025-12-21 00:44:42 +00:00
Bhavya U 9429ed59c1 fix: update string interpolation for extension installation messages (#2643) 2025-12-19 19:34:04 +00:00
Paul 749a8a92f9 Updates for Agent Skills alignment (#2634)
* update

* update telemetry

* update

* PR
2025-12-18 21:23:00 +00:00
Connor Peet ddf79de775 edits: avoid replacing explicit tabs in tex files (#2608)
* chore: disable prompt tracing by default, add a setting

Closes https://github.com/microsoft/vscode/issues/280972

* edits: avoid replacing explicit tabs in tex files

Closes https://github.com/microsoft/vscode/issues/261957
2025-12-16 18:37:00 +00:00
Connor Peet e45d9b5036 edits: extend diff processing time (#2593)
Closes https://github.com/microsoft/vscode/issues/281407

Don't think there's much better can do here sadly.
2025-12-15 22:48:34 +00:00
Ulugbek Abdullaev f6c423ab3e Support Instant Apply models from proxy's /models (#2560)
* test commit

* update to create a flag that sends data to the new endpoint

* set config to true

* create helper function to dedupe

* habdling race condition

* instant apply: refactor: use the model name variable instead of a string literal

* instant apply: refactor: do not use ?? to get default model

this's because the setting already has that model as the default, so accessing the setting will already return that default model name

also, don't use typeof but its a type for the setting

remove type annotations when accessing the setting value because the setting value type is inferred from the config's type

---------

Co-authored-by: Anisha Agarwal <anisagarwal@microsoft.com>
2025-12-12 16:24:32 +00:00
Henning Dieterichs ac79d3357e Track strings to calculate codeSurvivalRate (#2430)
* Track strings to calculate codeSurvivalRate

* Update test for the new telemetry adding

* Sends data to internal telemetry, adds more tests

* Also report survival rate after 0s and 5s

---------

Co-authored-by: xuga <xuga@MacBook-Pro-2.local>
2025-12-12 14:15:40 +00:00
Paul cc10535aef byok (#2529) 2025-12-11 00:28:14 +00:00
Paul 3256a1fe2a Add chat capabilities (#2492)
* add

* id
2025-12-08 23:49:30 +00:00
Matt Bierner 3c8134184b Enable no-unexternalized-strings in repo (#2448)
Enables the same `no-unexternalized-strings` with have in `vscode` in this repo. This make sure we have a more consistent style across repos and when generating edits
2025-12-05 18:45:12 +00:00
Martin Aeschlimann 6aa25cd215 allow reading personal skills, refining other isExternalInstructionsFile checks (#2392)
* allow reading personal skills, refining other isExternalInstructionsFile checks

* fix tests
2025-12-04 17:26:24 +00:00
Rob Lourens f98cfe337c Tweak to todolist tool override (#2276)
Copilot comments from #2274
2025-12-01 00:23:53 +00:00
Rob Lourens 2307f0294f Custom todo tool description for gpt models (#2274)
Fix #269031
2025-11-30 22:50:43 +00:00
Connor Peet fa50ac819a edits: fix replace_string not editing emptying file (#2212)
Closes https://github.com/microsoft/vscode/issues/277850
2025-11-26 14:09:28 +00:00
Connor Peet cdc797e34a edits: remove replace_string healing exp (#2117) 2025-11-20 19:45:25 +00:00
Bryan Chen 61c345044f Remove explicit 'any' (#1960)
* Remove explicit 'any'

* remove any

* fix typecheck failure

* export CopilotToolParamsBase

* replace any with unknown in toolsService

* fix typing for IEmbeddingsEndpoint

* fix tool types

* use `unknown` for tool contructor type
2025-11-19 17:36:29 +00:00
Rob Lourens 3a7f238cb4 Fix using the wrong runTest tool reference for prompt hints (#2066)
* Fix using the wrong runTest tool reference

* Update test snapshot
2025-11-19 00:03:57 +00:00
Bryan Chen 87af30b89c Support includeIgnoredFiles option in search results (#1868)
* feat: add option to include ignored files in search results

* Provide instruction of includeIgnoredFiles to models in case of missing match

* updated warnings
2025-11-18 15:13:40 +00:00
Sandeep Somavarapu fedde4f1f1 clean up: (#2040)
* clean up:
- simplify namespaces
- simplify defining settings

* fix unused configs
2025-11-17 14:32:52 +00:00
Connor Peet e4b5974b1a edits: fix conflicting edits in multi-replace-string (#2016)
* edits: fix conflicting edits in multi-replace-string

- Minimize identical content in text edits to avoid potential conflicts in context
- Explicitly error any edits that still fail rather than garbling the file

Closes https://github.com/microsoft/vscode/issues/277154

* rm test.only

* fix whitespaces not being preserved in ws flex match
2025-11-15 00:51:53 +00:00
Connor Peet 125097f3f6 edits: set hasError on tool results from editing tools (#2022)
Refs https://github.com/microsoft/vscode/issues/275056
2025-11-14 22:42:01 +00:00
Connor Peet 4572f4ee80 edits: don't prompt every edit for a folder within a default-system path (#1982)
Closes https://github.com/microsoft/vscode/issues/276193
2025-11-13 17:41:09 +00:00
Johannes Rieken 7d0512d26a add failing test for https://github.com/microsoft/vscode/issues/277154 (#1981)
* add failing test for https://github.com/microsoft/vscode/issues/277154

* thanks copilot

* better assertion
2025-11-13 15:58:14 +00:00
Rob Lourens f896a0a626 Validate tool inputs (#1975) 2025-11-13 07:11:08 +00:00
Don Jayamanne 30c867c483 Move formatUriForFileWidget into common (#1973) 2025-11-13 06:00:21 +00:00
Don Jayamanne e6a67133a7 Render links in file edit confirmation (#1970) 2025-11-13 01:23:01 +00:00