Repository navigation
fix(client): stop SSE reconnects when GET is unsupported - #1363
Open
aphonpra-oai wants to merge 1 commit into
Open
aphonpra-oai wants to merge 1 commit into
aphonpra-oai wants to merge 1 commit into
Conversation
Contributor
|
@bolinfest is on triage rotation this week and is the reviewer for this one. Labels come from the PR labeler. Please review the change. Automated triage. Labels are a first pass and the assigned maintainer has the final say. |
aphonpra-oai
marked this pull request as ready for review
October 15, 2026 17:11
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An SSE response can end before its final JSON-RPC result after supplying an event ID. The Streamable HTTP transport then resumes it with GET. If the server does not support GET and returns 405, the reconnect loop currently applies its retry policy to
ServerDoesNotSupportSseand can keep issuing rejected requests. The same problem occurs when an established server-event listener later reconnects to a server that rejects GET.This change treats
ServerDoesNotSupportSseas terminal for the affected stream. An interrupted request reports failure without replaying its POST, and later POST requests remain usable. Other reconnect errors retain the configured retry policy, so temporary failures can still recover. The initial optional listener GET already treats 405 as unsupported and keeps its existing behavior.The classification is internal to the reconnect connector; it does not change the public retry-policy API or add a shared endpoint-wide unsupported flag.
Reproduce with the included scripted client:
ServerDoesNotSupportSsefrom the resume GET.Validation covers initial listener rejection, established listener rejection, interrupted POSTs with and without event IDs, request recovery after three transient failures without POST replay, and delivery of a server notification after three transient listener failures.
Draft for maintainer review of this error-classification approach.
Checks:
cargo test -p rmcp --features client,transport-streamable-http-client --test test_streamable_http_reconnect_classification -- --test-threads 2: 6 passed.cargo test -p rmcp --features client,transport-streamable-http-client --lib transport::common::client_side_sse -- --test-threads 2: 17 passed.cargo +nightly fmt --all: passed.cargo clippy -p rmcp --features client,transport-streamable-http-client --test test_streamable_http_reconnect_classification: passed with the same eight existing unused/dead-code warnings seen on the unpatched implementation under this feature set.