feat(mcp): forward tools/call progress to Host - #5070
Open
wutongyuonce wants to merge 1 commit into
Open
Conversation
Wire SDK onprogress through McpClientManager.callTool into the CLI capability provider's existing Host progress hook. Drop incomplete or invalid step counts so a noisy server cannot fail the tool. Refs apache#5069 Generated-by: Pi
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.
Summary
Long-running MCP tools currently look frozen: the SDK already supports
onprogress/notifications/progress, and Runtime Host already forwards admitted(current, total)as transcripttool_progress, butMcpClientManager.callToolnever asked for a progress token and the CLI capability provider never calledoptions.progress.This PR wires those two existing seams. Invalid or incomplete progress is dropped so a noisy server cannot fail the tool. Listeners that throw are ignored for the same reason.
Fixes #5069
Verification
npm --workspace @maka/mcp run build && npm --workspace @maka/mcp run test:dist— 191 passednode --test packages/cli/dist/__tests__/runtime-host-capability-provider-command.test.js— 6 passedlint/format:check/ fullnpm testDid not attach UI evidence: this is protocol-to-Host wiring; coverage is the modern Streamable HTTP fixture plus the CLI provider snapshot test.
Review
Independent Codex review (read-only) found no must-fix issues. Follow-up from that review: the omit-
onProgresspath now asserts thetools/callrequest has noprogressToken. Skipped an extra E2E for invalid payloads —tool-progress.test.tsalready covers drop behavior.AI use
Select exactly one:
Tool(s) and scope: Pi implemented the wiring, tests, issue, and PR text. Codex ran a read-only review.
Checklist
Does this PR entail a change in behavior?