feat(core): add support for MCP progress updates#19046
Conversation
Summary of ChangesHello @NTaylorMullen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces comprehensive support for displaying real-time progress updates for long-running Model Context Protocol (MCP) tool calls. It integrates a new event system for progress notifications, updates the core MCP client to handle and report these notifications, and modifies the scheduler to track the progress state. The user interface has also been enhanced to visually present this progress information, providing users with better feedback during tool execution. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Size Change: +3.81 kB (+0.02%) Total Size: 24.5 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for Model Context Protocol (MCP) progress updates, providing real-time feedback for long-running tool calls. The changes are well-structured, spanning from the core event system and MCP client to the scheduler and CLI UI components. Key additions include the McpProgress event, a McpProgressReporter in the client to manage progress tokens, and UI updates to display progress messages and percentages. The implementation is robust, with proper handling of token registration/unregistration and state updates. The accompanying tests are thorough and cover the new functionality well. Overall, this is a solid feature addition that enhances the user experience for tool execution.
- Implement progressToken generation and notification handling in McpClient - Update Scheduler to listen for McpProgress events and update tool execution state - Enhance CLI UI to display real-time progress messages and percentages Fixes #6590
- Resolve CodeQL ReDoS vulnerabilities in markdown rendering by optimizing regex patterns - Update tool progress display to append to description and support standalone percentages (feedback from @chrstnb) - Implement Scheduler.dispose() to prevent memory leaks in coreEvents listeners (feedback from @chrstnb) - Add comprehensive tests for ReDoS protection and Scheduler cleanup Fixes #6590
- Undid regex optimizations in MarkdownDisplay.tsx and InlineMarkdownRenderer.tsx - Removed the ReDoS-specific test file - Retained progress display and memory management improvements from previous commit Fixes #6590
32e44c2 to
e2b75f2
Compare
… tool progress Enhances MCP progress reporting (layered on google-gemini#19046) with: - Visual progress bar component (McpProgressIndicator) using block characters, supporting determinate (percentage) and indeterminate (step count) modes - Per-callId leading+trailing throttle (100ms) in Scheduler to prevent UI lag from high-frequency MCP server progress events - Percentage capping at 100% for misbehaving servers - Input validation in emitMcpProgress rejecting NaN/negative/Infinity - Raw progress/progressTotal fields propagated through the pipeline for bar fill computation Fixes google-gemini#16934
… tool progress Enhances MCP progress reporting (layered on google-gemini#19046) with: - Visual progress bar component (McpProgressIndicator) using block characters, supporting determinate (percentage) and indeterminate (step count) modes - Per-callId leading+trailing throttle (100ms) in Scheduler to prevent UI lag from high-frequency MCP server progress events - Percentage capping at 100% for misbehaving servers - Input validation in emitMcpProgress rejecting NaN/negative/Infinity - Raw progress/progressTotal fields propagated through the pipeline for bar fill computation Fixes google-gemini#16934
… tool progress Enhances MCP progress reporting (layered on google-gemini#19046) with: - Visual progress bar component (McpProgressIndicator) using block characters, supporting determinate (percentage) and indeterminate (step count) modes - Per-callId leading+trailing throttle (100ms) in Scheduler to prevent UI lag from high-frequency MCP server progress events - Percentage capping at 100% for misbehaving servers - Input validation in emitMcpProgress rejecting NaN/negative/Infinity - Raw progress/progressTotal fields propagated through the pipeline for bar fill computation Fixes google-gemini#16934
… tool progress Enhances MCP progress reporting (layered on google-gemini#19046) with: - Visual progress bar component (McpProgressIndicator) using block characters, supporting determinate (percentage) and indeterminate (step count) modes - Per-callId leading+trailing throttle (100ms) in Scheduler to prevent UI lag from high-frequency MCP server progress events - Percentage capping at 100% for misbehaving servers - Input validation in emitMcpProgress rejecting NaN/negative/Infinity - Raw progress/progressTotal fields propagated through the pipeline for bar fill computation Fixes google-gemini#16934
… tool progress Enhances MCP progress reporting (layered on google-gemini#19046) with: - Visual progress bar component (McpProgressIndicator) using block characters, supporting determinate (percentage) and indeterminate (step count) modes - Per-callId leading+trailing throttle (100ms) in Scheduler to prevent UI lag from high-frequency MCP server progress events - Percentage capping at 100% for misbehaving servers - Input validation in emitMcpProgress rejecting NaN/negative/Infinity - Raw progress/progressTotal fields propagated through the pipeline for bar fill computation Fixes google-gemini#16934
… tool progress Enhances MCP progress reporting (layered on google-gemini#19046) with: - Visual progress bar component (McpProgressIndicator) using block characters, supporting determinate (percentage) and indeterminate (step count) modes - Per-callId leading+trailing throttle (100ms) in Scheduler to prevent UI lag from high-frequency MCP server progress events - Percentage capping at 100% for misbehaving servers - Input validation in emitMcpProgress rejecting NaN/negative/Infinity - Raw progress/progressTotal fields propagated through the pipeline for bar fill computation Fixes google-gemini#16934
… tool progress Enhances MCP progress reporting (layered on google-gemini#19046) with: - Visual progress bar component (McpProgressIndicator) using block characters, supporting determinate (percentage) and indeterminate (step count) modes - Per-callId leading+trailing throttle (100ms) in Scheduler to prevent UI lag from high-frequency MCP server progress events - Percentage capping at 100% for misbehaving servers - Input validation in emitMcpProgress rejecting NaN/negative/Infinity - Raw progress/progressTotal fields propagated through the pipeline for bar fill computation Fixes google-gemini#16934
Summary
Added support for Model Context Protocol (MCP) progress updates to provide real-time feedback for long-running tool calls.
Details
McpProgressevent and payload tocoreEvents.McpProgressReporterto manageprogressTokentocallIdmapping.notifications/progresshandler to receive and broadcast progress from servers.progressTokento the_metafield of tool call requests.ExecutingToolCalltype to trackprogressMessageandprogressPercent.Schedulerto listen for progress events and update the state manager.IndividualToolCallDisplayand mapping logic to propagate progress fields.ToolInfocomponent inToolShared.tsxto display the message and percentage in the tool header while executing.Example Test Server:
Related Issues
Fixes #6590
How to Validate
notifications/progressmethod).Pre-Merge Checklist