Repository navigation
feat: support experimental WebMCP client.reportProgress and ensure de… - #3
Merged
Merged
Conversation
…legation tools are always registered
andreban
force-pushed
the
feature/webmcp-client-report-progress
branch
from
May 22, 2026 09:43
7437b9a to
4f4853d
Compare
| : {}; | ||
| const ctx: ToolContext = { | ||
| onEvent: (event: AgentEvent) => { | ||
| if (event.type === "done") return; |
Owner
Author
There was a problem hiding this comment.
That's generally the same as the function returning.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This Pull Request implements support for WebMCP's experimental client-side progress reporting feature and fixes delegation tool registration to ensure they are always discoverable by external browser agents.
🚀 Key Changes
WebMCP
client.reportProgressIntegration (src/lib/WebMCPTools.ts):executefunction signature for registered WebMCP tools to support an optional second parameter:client?: { reportProgress?: (message: string) => void }.ToolContext.onEventto automatically stream raw, structuredAgentEventobjects directly as a serialized string usingJSON.stringify(event)toclient.reportProgress.doneevents (since the final payload is returned via the execution result).Unconditional Delegation Tool Discovery (
src/context/MCPProvider.tsx):if (!factory) return;check that was preventing delegation tools (delegate_to_skill,invoke_agent,invoke_planner,invoke_researcher,invoke_writer,invoke_reviewer) from being registered when no local Gemini API key was present on initial mount.workspaceCtx.factory) so that delegation tools are always advertised to and discoverable by external agents driving the workspace.Robust Test Environment Setup (
src/test/setup.ts):localStoragein the JSDOM Vitest environment, resolvingTypeError: localStorage.clear is not a functionerrors and restoring the entire test suite baseline to 100% health.🧪 Verification
src/lib/WebMCPTools.test.ts): Added a test verifying that progress callbacks (client.reportProgress) are correctly called with JSON-serializedAgentEventstrings representing the intermediate thinking steps and text deltas.