Skip to content

Backport abandoned-request resolution from 2.x to the 1.x Streamable HTTP client - #3444

Closed
zgj-ssslab wants to merge 1 commit into
modelcontextprotocol:v1.xfrom
zgj-ssslab:backport/resolve-abandoned-request-v1.x
Closed

Backport abandoned-request resolution from 2.x to the 1.x Streamable HTTP client#3444
zgj-ssslab wants to merge 1 commit into
modelcontextprotocol:v1.xfrom
zgj-ssslab:backport/resolve-abandoned-request-v1.x

Conversation

@zgj-ssslab

Copy link
Copy Markdown

Summary

On the 1.x line (v1.29.x, and the v1.x branch), a pending request stays unresolved forever when:

  • the server answers its POST with 202 Accepted,
  • the per-request SSE stream ends without carrying a response event, or
  • reconnection attempts are exhausted.

The caller only learns of the failure when its own deadline fires, and it surfaces as a timeout rather than a disconnect.

Fix

Port the _resolve_abandoned_request mechanism from 2.x (#3047, shipped in v2.0.0) to the 1.x StreamableHTTPTransport, adapted to the 1.x root-model message API:

  • a request answered with 202 Accepted is resolved with INVALID_REQUEST;
  • an SSE stream that ends without a response event and cannot be resumed is resolved with CONNECTION_CLOSED;
  • exhausted reconnection attempts resolve with CONNECTION_CLOSED;
  • notifications are not affected (they have no waiter to resolve).

How I checked

  • 4 new deterministic unit tests in tests/client/test_streamable_http_abandoned_request.py (no network, no real server): the three resolution paths above, plus a guard that a 202 for a notification injects nothing
  • Full tests/shared/test_streamable_http.py suite passes (58 tests), including test_streamable_http_multiple_reconnections

Fixes #3441

…HTTP client

On the 1.x line, a pending request stays unresolved forever when the
server answers its POST with 202 Accepted, when the per-request SSE
stream ends without carrying a response event, or when reconnection
attempts are exhausted: the caller only learns of the failure when its
own deadline fires, and it surfaces as a timeout rather than a
disconnect.

Port the _resolve_abandoned_request mechanism from 2.x (PR modelcontextprotocol#3047) to
the 1.x StreamableHTTPTransport: resolve the pending request with a
synthesized JSONRPCError (CONNECTION_CLOSED, or INVALID_REQUEST for the
202 case) at the three sites where its response can never arrive.
Notifications are not affected.

Fixes modelcontextprotocol#3441
@github-actions github-actions Bot added the missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md) label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

This PR has been closed automatically. This repo only keeps pull requests open when they come from a maintainer, or from a contributor a maintainer has assigned to the linked issue, and you aren't currently assigned to #3441.

If a maintainer assigns you to #3441, this PR reopens on its own and there's nothing more you need to do here. Assignment is a maintainer call based on capacity; comments that only ask to be assigned don't factor in. What does help is engaging on the issue itself by confirming the repro, explaining why it matters for your use case, or describing the approach you'd take.

You're welcome to keep pushing commits here (just avoid force-pushing, since GitHub can't reopen a rewritten branch), but that on its own won't get the PR reviewed or the issue assigned, and realistically most auto-closed PRs stay closed. There's no need to open a new PR either way.

CONTRIBUTING.md has the full reasoning, but in short:

  • We're a small team with very little capacity to review community PRs right now.
  • Many recent PRs are AI-generated with little human review, and reviewing one carefully still costs a maintainer as much time as it ever did. A well-described issue is usually more useful to us than the code.

Maintainers: reopen, remove missing-issue-link, or add bypass-issue-check to override.

@github-actions github-actions Bot closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant