Skip to content

fix: keep related request id zero from debouncing#2120

Open
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/related-request-id-zero-debounce
Open

fix: keep related request id zero from debouncing#2120
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/related-request-id-zero-debounce

Conversation

@he-yufeng
Copy link
Copy Markdown

Summary

  • treat numeric relatedRequestId: 0 as present when deciding whether a notification can be debounced
  • add regression coverage so related notifications for request id zero are sent immediately instead of being coalesced
  • add a patch changeset for @modelcontextprotocol/core

Fixes #2117

To verify

  • corepack pnpm --filter @modelcontextprotocol/core test -- --run packages/core/test/shared/protocol.test.ts
  • corepack pnpm --filter @modelcontextprotocol/core typecheck
  • corepack pnpm --filter @modelcontextprotocol/core lint
  • git diff --check origin/main..HEAD

The pre-push hook also passed the repo typecheck/build/lint tasks.

@he-yufeng he-yufeng requested a review from a team as a code owner May 18, 2026 18:12
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

🦋 Changeset detected

Latest commit: 24c73c2

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

This PR includes changesets to release 1 package
Name Type
@modelcontextprotocol/core 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
Copy link
Copy Markdown

pkg-pr-new Bot commented May 18, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@2120

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/codemod@2120

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@2120

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@2120

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/fastify@2120

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@2120

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@2120

commit: 24c73c2

@he-yufeng he-yufeng force-pushed the fix/related-request-id-zero-debounce branch from ffe6967 to a4de0df Compare May 21, 2026 07:51
@he-yufeng
Copy link
Copy Markdown
Author

Rebased this on the latest main and re-ran the focused checks locally:

  • pnpm --filter @modelcontextprotocol/core exec vitest run test/shared/protocol.test.ts -t "relatedRequestId 0"
  • pnpm --filter @modelcontextprotocol/core exec vitest run test/shared/protocol.test.ts
  • pnpm --filter @modelcontextprotocol/core run typecheck
  • pnpm --filter @modelcontextprotocol/core run lint
  • pre-push hook: pnpm -r typecheck, pnpm -r build, pnpm sync:snippets --check, pnpm -r lint

@he-yufeng he-yufeng force-pushed the fix/related-request-id-zero-debounce branch from a4de0df to 24c73c2 Compare May 24, 2026 10:32
@he-yufeng
Copy link
Copy Markdown
Author

Rebased this on the latest main and re-ran the focused/core checks locally:

  • pnpm --filter @modelcontextprotocol/core exec vitest run test/shared/protocol.test.ts -t "relatedRequestId 0"
  • pnpm --filter @modelcontextprotocol/core exec vitest run test/shared/protocol.test.ts
  • pnpm --filter @modelcontextprotocol/core run typecheck
  • pnpm --filter @modelcontextprotocol/core run lint
  • git diff --check upstream/main..HEAD
  • pre-push hook: pnpm -r typecheck, pnpm -r build, pnpm sync:snippets --check, pnpm -r lint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

relatedRequestId 0 is treated as absent by notification debounce guard

1 participant