Emit event: message on streamable-http SSE frames - #5954
Merged
ChrisJBurns merged 4 commits intoJul 28, 2026
Conversation
stantheman0128
requested review from
ChrisJBurns,
JAORMX,
amirejaz,
blkt,
jhrozek and
rdimitrov
as code owners
July 23, 2026 20:05
stantheman0128
force-pushed
the
fix/5655-sse-event-name
branch
from
July 25, 2026 18:39
fa19b64 to
aca4e76
Compare
Signed-off-by: Stan Shih <stantheman0128@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
stantheman0128
force-pushed
the
fix/5655-sse-event-name
branch
from
July 28, 2026 02:28
aca4e76 to
d1cd71f
Compare
Contributor
Author
|
Rebased onto current
If |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5954 +/- ##
==========================================
+ Coverage 72.40% 72.43% +0.03%
==========================================
Files 733 733
Lines 75845 75845
==========================================
+ Hits 54918 54942 +24
+ Misses 17034 17013 -21
+ Partials 3893 3890 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
|
Thanks for the PR @stantheman0128 ! 🚀 |
ChrisJBurns
approved these changes
Jul 28, 2026
Collaborator
|
/retest |
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.
Summary
The streamable-http proxy wrote JSON-RPC SSE frames as
data:-only (noevent:line). That is legal per WHATWG SSE (unnamed frames dispatch asmessage), but it diverges from MCP reference transports and ToolHive's ownssecommonserializer, which always emitevent: message. Spec-lenient clients such as@ai-sdk/mcponly dispatch frames whereevent === "message"and hang oninitializeagainst stdio servers fronted by this proxy. The same omission also breaks ToolHive vMCP backend init when responses arrive on the GET/async SSE stream (see issue comments).What changed
writeSSEDatahelper to emitevent: message\ndata: ...\n\nwriteSSEErrorEvent), GET standalone notifications, and progress framesevent: messageFixes #5655
Type of change
Test plan
go test ./pkg/transport/proxy/streamable/ ...)task test-e2e)task lint-fix)Evidence
HEAD before fix:
writeSSEDatausedfmt.Fprintf(w, "data: %s\n\n", data)only.After fix, sample SSE frame bytes (hex):
Decoded:
Targeted tests (Windows):
Full package (skipping pre-existing unrelated failure on main from #5944, where filtered
tools/callnow returns HTTP 200 JSON-RPC instead of 400):What was not tested
@ai-sdk/mcpor vMCP operator click-through on this box (no studio / cluster harness here). Framing is asserted via raw SSE bytes on the proxy's own HTTP path.task lint-fix/ e2e suite (targeted package tests only).Does this introduce a user-facing change?
Yes. Streamable-http proxy SSE responses now include an explicit
event: messageline, matching MCP reference transports. Clients that already accept data-only frames remain compatible.Special notes for reviewers
Fprintfsites inhandleSingleRequestSSEand were closed for the claim/assignment process. Since then those writers consolidated intowriteSSEData; fixing the helper is the complete fix for POST, GET, progress, and error paths.AI disclosure
This change was developed with AI assistance (Cursor/Grok). The author reviewed the diff, ran the Evidence commands above, and takes responsibility for the patch.