[1.x] fix(client): retry SSE stream after receiving session ID#1520
Open
LucaButBoring wants to merge 3 commits intomodelcontextprotocol:v1.xfrom
Open
[1.x] fix(client): retry SSE stream after receiving session ID#1520LucaButBoring wants to merge 3 commits intomodelcontextprotocol:v1.xfrom
LucaButBoring wants to merge 3 commits intomodelcontextprotocol:v1.xfrom
Conversation
Backport from test/roots-list branch with v1.x adaptations. Covers request/response, empty lists, multiple roots, optional fields, listChanged notification, and handler context verification.
Fixes server-initiated requests (roots/list, sampling, elicitation) hanging over HTTP transport. The client now retries opening the GET SSE stream after receiving a session ID during initialization. Fixes: modelcontextprotocol#1167
|
9 tasks
commit: |
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.
Fixes server-initiated requests (roots/list, sampling, elicitation) hanging over sHTTP when not issued as part of a client-to-server request. The client now retries opening the GET SSE stream after receiving a session ID during initialization.
Motivation and Context
Without this fix, sending requests to the client (particularly roots/elicitation requests) hangs on the server unless that is bounded by some other request, like a tool call. Naturally, this doesn't guarantee compatibility with any other SDK, but at least ensures that using the client and server from this SDK together works as intended.
How Has This Been Tested?
Updated unit/integration tests.
Breaking Changes
None.
Types of changes
Checklist
Additional context
Should fix #1167
v2: #1521