Repository navigation
fix(devframe): use WebMCP draft tool hints and honor abort signal - #496
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
👁️🗨️ Review this pull request with grouped, summarized diffs at: raw result💭 analyzed by |
antfu
approved these changes
Nov 18, 2026
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
The WebMCP projection in
devframe/clientused MCP's annotation names. The current WebMCP draft defines its ownToolAnnotations(readOnlyHint,consequentialHint,untrustedContentHint,debugging) and has nodestructiveHint. WebIDL drops unknown dictionary members, so browsers that follow the draft never saw that a tool was destructive.Changes in
registerWebMcpTools:readsetsreadOnlyHint,destructivesetsconsequentialHint, and every tool setsdebugging: true(devframe tools are developer tooling, the case the draft names).titleis set at the top level of the tool, as in the draft'sModelContextTool.destructiveHintandannotations.titlestay, for earlier drafts and polyfills that follow the MCP shape.execute(input, { signal })now honors the signal. An aborted call rejects withsignal.reason. A call whose signal is already aborted does not run the handler. A running handler cannot be stopped, so its late result is dropped.A separate fix in
node/client-agent.ts: when a tab re-syncs its tools, the check compared only tool ids. A changed description or input schema under the same id did not notify MCP clients that the tool list changed. It now compares the whole manifest.Spec reference: WebMCP draft
index.bs(ToolAnnotations,ModelContextTool,execute(input, { signal })).User prompts
Model: Claude Opus 5.5 in Claude Code (Paseo).
Verification
pnpm vitest run packages/devframe/src/client/webmcp.test.ts packages/devframe/src/node/__tests__/client-agent.test.ts: 21 passed. New tests cover the draft hints,consequentialHinton destructive tools, rejection on abort (during a call and before it), and a notify on a changed manifest under the same id.pnpm lint,pnpm knip,pnpm typecheck,pnpm build: pass.pnpm test: 1871 passed, 2 failed. The failures areadapters/__tests__/dev.test.ts("does not share a port held on 127.0.0.1") andadapters/__tests__/initiate.test.ts("ws.sidecar on localhost"), withProxy response (502)from the sandbox HTTP proxy. Both fail the same way onmain(06d41e39) with this diff removed.devframe/clienttype snapshot is updated for the new optional fields and theexecuteoptions argument.This PR was written with an AI agent. The human gave the task and chose the scope. The human has not reviewed the diff yet.