fix: handle cancellation for request id zero - #2138
Conversation
🦋 Changeset detectedLatest commit: c640656 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/server
@modelcontextprotocol/server-legacy
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
0d326bf to
a3d7042
Compare
|
Rebased this on the latest
|
a3d7042 to
553b6b6
Compare
|
Added the @modelcontextprotocol/core patch changeset and force-pushed 553b6b6. Local validation: changeset status shows @modelcontextprotocol/core patch; focused requestId 0 test passed; full core protocol.test.ts passed with 151 tests; core typecheck and lint passed; git diff --check passed. Pre-push typecheck, build, and lint also passed. |
553b6b6 to
c640656
Compare
|
Rebased on current The resolved diff is still only the intended request-id-zero cancellation fix: Validated locally:
The pre-push hook also completed the repo-wide build, typecheck, and lint steps successfully. |
|
Closing this during backlog cleanup. This queue has many review-required MCP TypeScript SDK PRs, and this item is lower priority than the remaining transport/protocol fixes with clearer current value. I can reopen or refresh it if maintainers want this exact change. |
Summary
requestId: 0when handlingnotifications/cancelled0Fixes #2115.
Validation
pnpm --filter @modelcontextprotocol/core exec vitest run test/shared/protocol.test.ts -t "notifications/cancelled behavior"pnpm --filter @modelcontextprotocol/core exec vitest run test/shared/protocol.test.tspnpm --filter @modelcontextprotocol/core run typecheckpnpm --filter @modelcontextprotocol/core run lintpnpm -r typecheck,pnpm -r build,pnpm sync:snippets --check,pnpm -r lintgit diff --check