Skip to content

Settle pending requests when the SSE response leg ends early - #2830

Open
ege-arhan wants to merge 1 commit into
modelcontextprotocol:mainfrom
ege-arhan:fix-2739-stream-end
Open

ege-arhan wants to merge 1 commit into
modelcontextprotocol:mainfrom
ege-arhan:fix-2739-stream-end

Conversation

@ege-arhan

Copy link
Copy Markdown

With StreamableHTTP, a POST can get a text/event-stream body that hits EOF or errors before the matching JSON-RPC response arrives. The transport already notices this and fires onRequestStreamEnd, but Protocol.request never passed that callback into transport.send, so the pending request just sat there until the outer timeout.

This threads the callback through: the caller's onRequestStreamEnd still runs, and the request now rejects promptly with ConnectionClosed instead of waiting for a timeout. Verified with tsc --noEmit clean and the 49 protocol tests passing.

@ege-arhan
ege-arhan requested a review from a team as a code owner September 18, 2026 07:43
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@changeset-bot

changeset-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e37001f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

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

@modelcontextprotocol/codemod

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

@modelcontextprotocol/core

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

@modelcontextprotocol/server

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

@modelcontextprotocol/server-legacy

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

@modelcontextprotocol/express

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

@modelcontextprotocol/fastify

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

@modelcontextprotocol/hono

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

@modelcontextprotocol/node

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

commit: e37001f

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.

1 participant