chat: allow tools to report progress#246768
Merged
connor4312 merged 7 commits intomainfrom Apr 23, 2025
Merged
Conversation
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.
53f2d38 to
3876871
Compare
|
Delete |
roblourens
reviewed
Apr 17, 2025
jrieken
requested changes
Apr 17, 2025
Member
Author
|
Sounds good, will adjust 👍 |
roblourens
reviewed
Apr 17, 2025
Member
roblourens
left a comment
There was a problem hiding this comment.
We should discuss in the API sync too. MCP servers can take advantage of this now? Would like to finalize it next month at least.
src/vs/workbench/contrib/chat/browser/languageModelToolsService.ts
Outdated
Show resolved
Hide resolved
jrieken
previously requested changes
Apr 22, 2025
src/vs/workbench/contrib/chat/browser/languageModelToolsService.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInvocationPart.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.ts
Outdated
Show resolved
Hide resolved
ce2438d to
9ea17f8
Compare
connor4312
commented
Apr 22, 2025
This reverts commit c6c85b3.
lszomoru
approved these changes
Apr 23, 2025
|
👋 @connor4312 My server sent |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 adds a
toolProgressproposed API that allows extensions to reportprogress keyed on the
toolInvocationToken. Internally, when given to atool, 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.
25-04-7d106ff6-a3f5-47f1-9c07-f428a166149c.1.mp4
Involved some changes in the progress service internally:
viewIdwas a naked string, I wrapped it in an object tomake it more identifiable.
workbench/servicesand directly callsinto other services to effect progress. In leui of going for a full
'contribution' model, I made a small
ILanguageModelToolProgressServicethat 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.
Closes #244754
Closes #244751 (last adoption item)