Skip to content

Conversation

@ihrpr
Copy link
Contributor

@ihrpr ihrpr commented Apr 8, 2025

Fixing connection closing, noticed when writing examples of server and client. When sending POST with list tools request, noticed that the connection still alive. The root cause was that we were looking at relatedRequestId instead of message.id for the response. Response would not have relatedRequestId, only notifications will have it.

Follow up

(form stacked PR)

  • Refactor oauth to be shared with sse client
  • Examples for client and server
  • Integration tests using examples
  • Resumability
  • Session management
  • Server and client to handle requests returning not only streams but also JSON

@ihrpr ihrpr requested a review from jspahrsummers April 8, 2025 15:19
@ihrpr ihrpr marked this pull request as ready for review April 8, 2025 15:19
Comment on lines +364 to +365
// If the message is a response, use the request ID from the message
requestId = message.id;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we instead ensure that relatedRequestId is set for responses? (Although this is a good backup if it's not possible to guarantee.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a way to always guarantee that relatedRequestId is set for request, I'd leave this as a backup

Base automatically changed from ihrpr/streamable-http-client to main April 9, 2025 11:57
@ihrpr ihrpr merged commit 27d2996 into main Apr 9, 2025
2 checks passed
@ihrpr ihrpr deleted the ihrpr/fix-streamable-connection-close branch April 9, 2025 11:59
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.

3 participants