Repository navigation
test: cover SSE connections end to end - #9
Merged
Merged
Conversation
No test connected over SSE successfully, so the header injection fixed in kriasoft#11 (Headers instances were spread into nothing, dropping the transport's Accept header) had no end-to-end guard. A minimal legacy SSE server fixture stands in for the one the SDK v2 server package dropped; the test checks that server headers reach both the event stream and the POSTs, that SDK headers win on conflict, and that the header timeout leaves an established stream open. It replaces the narrower header test that stopped at the first request.
koistya
force-pushed
the
fix/header-merge
branch
from
September 30, 2026 20:07
4cf2e6b to
867378d
Compare
Member
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 header-merge fix this PR proposed (merging through
HeaderssoHeaders-instance request headers survive) landed inmainwith #11. This PR now adds the missing end-to-end coverage for it: before this, no test connected over SSE successfully.test/utils/legacy-sse-server.ts: a minimal legacy HTTP+SSE MCP server. The SDK v2 server package no longer ships one.GET /sseannounces a POST endpoint, and responses come back over the stream.src/mcp-client.test.tsconnects over SSE and checks that:GET) and thePOSTs;Accept: text/event-stream,Content-Type: application/json);Verification
bun run validate: 98 pass, 1 skip. The new test also passed 20 repeated runs.Acceptbecomes*/*), against reversed header precedence, and against a timeout that isn't cleared once headers arrive.