-
Notifications
You must be signed in to change notification settings - Fork 266
Fix: Skip non-message SSE events in processStream #637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Skip non-message SSE events in processStream #637
Conversation
Fixes modelcontextprotocol#636 - SDK now ignores ping and other non-message events
findleyr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix, and thorough tests!
|
Looks like |
|
Added formatting commit (SHA: 1172815). I ran ok github.com/modelcontextprotocol/go-sdk (cached) |
|
Thanks — I formatted |
Fixes #636
Problem
The StreamableClientTransport tries to JSON-decode ALL SSE events, including ping events sent by servers for keep-alive purposes. This causes errors like 'invalid character 'p' looking for beginning of value' when encountering non-JSON event data.
Solution
Modified processStream to check evt.Name and skip events that are not 'message' events (or unnamed events, which default to 'message' per SSE spec).
Changes
Testing