Skip to content

chat: allow tools to report progress #246768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 23, 2025
Merged

Conversation

connor4312
Copy link
Member

@connor4312 connor4312 commented Apr 16, 2025

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.

25-04-7d106ff6-a3f5-47f1-9c07-f428a166149c.1.mp4

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.

Closes #244754
Closes #244751 (last adoption item)

@connor4312 connor4312 self-assigned this Apr 16, 2025
@vs-code-engineering vs-code-engineering bot added this to the April 2025 milestone Apr 16, 2025
@ghost
Copy link

ghost commented Apr 16, 2025

Uploading IMG_0275.png…

@ghost
Copy link

ghost commented Apr 16, 2025

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.
@connor4312 connor4312 force-pushed the connor4312/tool-progress-messages branch from 53f2d38 to 3876871 Compare April 17, 2025 02:42
@ghost
Copy link

ghost commented Apr 17, 2025

Delete

@connor4312
Copy link
Member Author

Sounds good, will adjust 👍

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@connor4312 connor4312 force-pushed the connor4312/tool-progress-messages branch from ce2438d to 9ea17f8 Compare April 22, 2025 16:20
@connor4312 connor4312 requested a review from jrieken April 22, 2025 16:21
@connor4312 connor4312 enabled auto-merge (squash) April 23, 2025 18:13
@connor4312 connor4312 disabled auto-merge April 23, 2025 18:14
@connor4312 connor4312 enabled auto-merge April 23, 2025 18:14
@connor4312 connor4312 merged commit e7cdecf into main Apr 23, 2025
8 checks passed
@connor4312 connor4312 deleted the connor4312/tool-progress-messages branch April 23, 2025 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support progress messages for tools mcp: adopt MCP 2025-03-26
4 participants