Skip to content

fix(core): keep resumption options off cancellation notifications - #2649

Draft
LizunovSergey wants to merge 2 commits into
modelcontextprotocol:mainfrom
LizunovSergey:fix/v2-2646-cancel-resumption
Draft

fix(core): keep resumption options off cancellation notifications#2649
LizunovSergey wants to merge 2 commits into
modelcontextprotocol:mainfrom
LizunovSergey:fix/v2-2646-cancel-resumption

Conversation

@LizunovSergey

Copy link
Copy Markdown

Fixes #2646.

Root cause

When a legacy-era request was aborted, Protocol reused the original request's full transport options for notifications/cancelled. If that request carried a resumptionToken, StreamableHTTPClientTransport interpreted the cancellation send as a resume operation, swallowed the notification, and opened a resumed GET instead of posting the cancellation.

Fix

  • Keep relatedRequestId on the cancellation send so request correlation is preserved.
  • Do not pass resumptionToken or onresumptiontoken to the cancellation notification.
  • Add a regression test that records the transport options for the cancellation send.
  • Add a patch changeset for @modelcontextprotocol/core.

Validation

  • Regression test fails against the previous implementation and passes with this change.
  • pnpm --filter @modelcontextprotocol/core-internal test: 69 files, 1,434 tests passed.
  • Monorepo build passed via the pre-push hook.
  • Monorepo typecheck passed via the pre-push hook.
  • pnpm lint:all passed.
  • Changeset status and formatting checks passed.

@changeset-bot

changeset-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3445994

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@modelcontextprotocol/core Patch
@modelcontextprotocol/client Patch
@modelcontextprotocol/core-internal Patch
@modelcontextprotocol/server-legacy Patch
@modelcontextprotocol/server Patch
@modelcontextprotocol/codemod Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2649

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2649

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@2649

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2649

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2649

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2649

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2649

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2649

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2649

commit: 3445994

@claude claude Bot added the v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Projects

None yet

1 participant