Commit Graph
85 Commits
Author SHA1 Message Date
Matt Bierner de93d65144 Remove a few more chat session id usages
For #274403

Confirmed that the api change should not effect copilot-chat
2026-02-17 17:17:10 -08:00
Matt Bierner 87173b4915 Remove IToolInvocationContext.sessionId
For #274403

Confirmed that this is not used in copilot
2026-02-10 15:38:57 -08:00
Rob Lourens 03bd51cfa3 Move PreToolUse to extension (#294042)
* Move PreToolUse to extension

* Migrate PostToolUse
2026-02-10 08:26:10 -08:00
Rob Lourens c7a9f45792 Enhance preToolUse hook and clean up code (#293265)
* Flesh out preToolUse hook

* Cleanup

* cleanups

* Cleanup
2026-02-06 14:53:25 +11:00
Connor Peet 7f028225fe tools: allow contributing runtime tools to toolsets 2026-01-21 15:39:17 -08:00
Connor Peet d042844bd5 Merge remote-tracking branch 'origin/main' into dev/bhavyau/tools-model 2026-01-21 12:59:52 -08:00
Matt Bierner ac06186ae1 Add sessionResource to proposed apis
For #274403

Replacing chatSessionId in a few API proposals. Keeping around the old fields for now until we can adopt this everywhere
2026-01-20 15:09:30 -08:00
Martin Aeschlimann b345708efb chat.tools still show the old runSubagent tool (#289125) 2026-01-20 15:35:03 +00:00
Connor Peet 85c01a84c9 Merge remote-tracking branch 'origin/main' into dev/bhavyau/tools-model 2026-01-15 07:14:36 -08:00
Logan Ramos 4dbed8161a Don't have default tool progress message (#287938) 2026-01-14 18:52:05 -08:00
Rob Lourens 32cdd274e8 Implement UX for running subagents in parallel (#287687)
* Support UX for parallel subagents
Similar to thinking ux

* Show prompt when expanded as well

* Add ellipsis

* Fix unit test

* Get subagents working with tool streaming changes

* Fixes

* Just keep this the same, close enough
2026-01-15 07:49:56 +08:00
Connor Peet 11ef18e302 Merge remote-tracking branch 'origin/main' into dev/bhavyau/tools-model 2026-01-14 11:59:00 -08:00
Logan RamosandCopilot 6b31b753c7 Support streaming of partial tool data (#278640)
* Start work on handling tool stream

* Start working on rendering tool progress

* Handle complete better

* Inovcation message

* Revert "Inovcation message"

This reverts commit f502d22d9a.

* Reapply "Inovcation message"

This reverts commit 855668653f.

* Revert "Reapply "Inovcation message""

This reverts commit 4c4db3ac36.

* Handle updating progress

* Better messages

* Have progress re-render if content changes

* Fix import

* Move prepare to view layer

* Clean up diff

* Pass tool call id through

* Pin it

* Modify the progress tool flow to use the same part + observables

* Some more debug logs

* Address feedback

* Plumb tool call id through to invoke

* Address connor's typing feedback

* Fix import

* Fix session operation log

* Update src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.ts

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

* Remove debug logging

* fix wrong enums

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-14 13:27:49 -05:00
Connor Peet 8d3270de42 chat: wip on model-specific tools
This is a rethinking of the initial API proposed in `languageModelToolSupportsModel.d.ts`.

1. This switches to `models?: LanguageModelChatSelector[];` to control enablement.
   definitely open to switching this out, but I think a synchronously-analyzable
   expression is important to retain the data flows in core without too many races.
2. The extension is able to define a tool at runtime via registerToolDefinition. This
   should let us have entirely service-driven tools from model providers without
   requiring a static definition for each one. We can also have model-specific
   variants of tools without a ton of package.json work for each variant of the tool
   (as initially proposed using `when` clauses)

This then propagates that down into the tools service. Currently I have this as just
compiling to a `when` expression once it reaches the main thread. Then, for the tools
service, it takes an IContextKeyService in cases where tools should be enumerated,
and the chat input sets the model keys in its scoped context key service. This allows
the tools to be filtered correctly in the tool picker.

I initially thought about allowing multiple definitions be registered for the same tool
name/id for model-specific variants of tools but I realized that gets really gnarly and
we already have a `toolReferenceName` that multiple tools can register into.

Todo for tomorrow morning:
- Tools don't make it to the ChatRequest yet, or something, still need to investigate
- Need to make sure tools in prompts/models all work. For a first pass I think we can
  let prompts/modes reference all tools by toolReferenceName.
- Validate that multiple tools actually can safely share a reference name (and do
  some priority ordering?)
- General further validation
- Some unit tests
2026-01-13 16:02:29 -08:00
Connor Peet d94a1fb7f5 Merge remote-tracking branch 'origin/main' into dev/bhavyau/tools-model 2026-01-13 10:53:28 -08:00
Rob Lourens 99d8a2706e Reorganize workbench/contrib/chat (#285467)
* Move some tools files

* chat/accessibility

* Fix this

* Move model files into model/

* Move tool invocation into model/

* Move builtinTools under tools/

* Add common/ui/ folder

* attachments/ and participants/

* browser/widget/ folder

* attachments/ and tools/

* widgetHosts/

* widget/modelPcker/ and context/

* Doc and more organizing

* widget/input/

* widget/chatContentParts/

* More cleanup in common/

* Tweak docs, move a file

* Break up contrib/ folder

* Fix test/ files
2025-12-31 13:02:33 -08:00
bhavyaus 6d7b8fc9ef Update invokeTool to support Language 2025-11-24 17:33:37 -08:00
bhavyaus 5925b35321 refactor: simplify access to supportsModel API in ExtHostLanguageModelTools 2025-11-24 15:28:33 -08:00
bhavyaus d228b3c65e add supportsModel API to language model tools for dynamic model compatibility 2025-11-24 15:17:48 -08:00
bhavyaus 1a40cd0525 Support tool filtering by model 2025-11-24 13:24:03 -08:00
Connor Peet a26d022775 tools: fix invocation token not round tripping with new sessions URIs (#277498) 2025-11-14 19:34:56 +00:00
Matt Bierner ab4a32e5a9 Make sure we preserve the right session id/resource for agent calls
When I fixed the uris used to identify sessions, it revealed this bug for non-local session.

The main part of this change is avoiding the call to `LocalChatSessionUri.forSession` in mainThreadChatAgent. This call can't be used for non-local chat sessions

The subagents tool part of this change unfortunately makes it a lot larger
2025-11-06 16:27:04 -08:00
9116007eee finalize languageModelDataPart and tools api (#265537)
* finalize datapart and tools api

* remove test fo languagemodel part 2

* delete languagemodeldata part, move to thinking for now

* bump version of chatprovider

* update api comments

* add aliases for languyagemodelToolresult and part

* Add to impl

* fix some finalization commentx

* remove extra instance check

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

* Apply suggestion from @mjbvz

Co-authored-by: Matt Bierner <12821956+mjbvz@users.noreply.github.com>

* Apply suggestion from @mjbvz

Co-authored-by: Matt Bierner <12821956+mjbvz@users.noreply.github.com>

* Apply suggestion from @mjbvz

Co-authored-by: Matt Bierner <12821956+mjbvz@users.noreply.github.com>

* Apply suggestion from @mjbvz

Co-authored-by: Matt Bierner <12821956+mjbvz@users.noreply.github.com>

* Apply suggestion from @mjbvz

Co-authored-by: Matt Bierner <12821956+mjbvz@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Matt Bierner <12821956+mjbvz@users.noreply.github.com>
2025-10-14 15:12:05 -07:00
Matt Bierner 360c9fd134 Add lint rule for as any and bulk ignore all existing breaks
For #269213

This adds a new eslint rule for `as any` and `<any>({... })`. We'd like to remove almost all of these, however right now the first goal is to prevent them in new code. That's why with this first PR I simply add `eslint-disable` comments for all breaks

Trying to get this change in soon after branching off for release to hopefully minimize disruption during debt week work
2025-10-02 23:38:33 -07:00
Rob Lourens 62ddb3df46 Indent tool calls made inside the execute_task subagent (#268588)
* Indent tool calls made inside the execute_task subagent

* format
2025-09-27 10:20:41 +09:00
Connor Peet 0a19961637 tools: display progress bar for tools that report numeric progress (#266064)
Closes https://github.com/microsoft/vscode/issues/264093
2025-09-10 10:49:00 -07:00
Rob Lourens d668f8317b Fixes for tool invocations/confirmations to work better with external agents (#264180)
For #262756
2025-08-30 14:42:07 -07:00
Daniel Imms 9e6770eee7 Remove IChatTerminalToolInvocationData
Fixes #256552
2025-07-22 09:12:32 -07:00
Connor Peet 25d003bcf6 tools: surface tool source in chat additions api (#256558)
For MCP I can already kind of get this from the tool name, but for
extension tools we previously had no way to know which extension
provided the tool.

This PR adds a `LanguageModelToolInformation.source` containing details
about where the tool came from. I also use this to include the MCP
server instructions which is needed for #250017.

cc @aeschli @roblourens
2025-07-17 22:25:25 +02:00
Rob Lourens 27267ee085 Include session id with LanguageModelToolInvocationPrepareOptions (#252257)
* Include session id with LanguageModelToolInvocationPrepareOptions

* Fix random token change from copilot
2025-06-25 05:44:20 +02:00
Benjamin Pasero 0ac8174fbc debt - reduce some explicit any use (#251182)
<!-- Thank you for submitting a Pull Request. Please:
* Read our Pull Request guidelines:
  https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests
* Associate an issue with the Pull Request.
* Ensure that the code is up-to-date with the `main` branch.
* Include a description of the proposed changes and how to test them.
-->
2025-06-11 02:51:06 -07:00
Don Jayamanne b4912823f4 Add presentation property for private chat terminal API (#249936) 2025-05-27 20:50:17 -07:00
Joyce Er 7b2e3090b7 fix: use markdown string for MCP tool confirmation (#249497)
* feat: allow markdown strings in chat confirmation titles

* fix: use markdown string for MCP tool confirmation
2025-05-21 16:38:55 -07:00
Johannes d6060be7cb don't clear tools, better apiObject implementation 2025-04-30 11:02:29 +02:00
Johannes c80027e7b4 stable vscode.lm.tools instances
https://github.com/microsoft/vscode-copilot/issues/16536
2025-04-29 16:37:42 +02:00
Justin Chen 07906e72e6 Merge branch 'main' into connor4312/kabutops 2025-04-24 10:04:33 -07:00
Connor Peet 41cc1e2836 update with api feedback 2025-04-23 11:09:15 -07:00
Connor Peet dd5b6c1235 Revert "pass in an options object instead"
This reverts commit c6c85b3e9d.
2025-04-23 10:58:44 -07:00
Connor Peet c6c85b3e9d pass in an options object instead 2025-04-22 10:33:18 -07:00
Connor Peet 9ea17f8a1c pr comments 2025-04-22 09:20:51 -07:00
Connor Peet 1c25dfb91a tools: some tweaks to make images work e2e, support mcp 2025-04-21 15:54:44 -07:00
Connor Peet eb62aa4adb Merge remote-tracking branch 'origin/main' into pr/justschen/246553 2025-04-21 14:59:52 -07:00
Connor Peet edc8644253 be less creative ;) 2025-04-17 10:51:04 -07:00
Connor Peet 38768712a3 chat: allow tools to report progress
This adds a `toolProgress` proposed API that allows extensions to report
progress keyed on the `toolInvocationToken`. Internally, when given to a
tool, this now includes the call ID of the tool.

We can use that both from extensions and internally to report progress
for tools, and I hooked this up for MCP servers. Currently only the text
is updated.

Involved some changes in the progress service internally:

- Previously `viewId` was a naked string, I wrapped it in an object to
  make it more identifiable.
- The progress service is in `workbench/services` and directly calls
  into other services to effect progress. In leui of going for a full
  'contribution' model, I made a small `ILanguageModelToolProgressService`
	that it writes state into and that can be read back out. The state
	(an observable) is kept as long as progress is ongoing or this is
	is an observer.
2025-04-16 19:42:32 -07:00
Sandeep Somavarapu cebb5e5a05 introduce search extensions tool (#246721)
* introduce search extensions tool

* update tool reference name
2025-04-16 16:21:04 +02:00
Rob Lourens 63c455f9bf Clean up internal edit file tool, take a proper URI from the extension (#246451)
* Clean up internal edit file tool, take a proper URI from the extension
Move more work back to the extension
For microsoft/vscode-copilot#15348

* Remove this
2025-04-14 15:52:57 -07:00
Your Name b90d747939 images in tool call first pass 2025-04-14 14:59:47 -07:00
Rob Lourens 2bdf282f0a Pass model to tools (#244323)
* Pass model to tools
When tools make requests, they should use the right model. So we
- save the model id on the request
- look it up when the tool is invoked
- resolve it to a LanguageModelChat in the EH

* Fix build
2025-03-22 06:42:06 +00:00
Tyler James Leonhardt c64359d91d Add InternalFetchWebPageToolId to proposed API (#244061)
@roblourens's feedback here https://github.com/microsoft/vscode/pull/243922#discussion_r2002313669
2025-03-20 14:26:25 -07:00
Rob Lourens dd6e06a8f2 Add onDidDisposeChatSession to enable closing chat terminals when a chat session ends (#244030) 2025-03-19 20:22:38 +01:00