Fix gateway passthrough issue - #266
Merged
Merged
Conversation
added 4 commits
July 16, 2026 15:01
Summary: - Capture Mcp-Session-Id from Streamable HTTP requests, including case-insensitive header matches. - Store the session id on the HTTP/SSE protocol filter for request-session association.
Summary: - Treat end-of-stream HTTP JSON-RPC bodies as a single JSON document before falling back to newline-delimited parsing. - Extend reconnect readiness wait for remote HTTPS/SSE backends using the configured request timeout. - Add low-noise MCP flow logs around HTTP/SSE body forwarding, JSON-RPC parsing, and server dispatch.
dIvYaNshhh
reviewed
Jul 22, 2026
dIvYaNshhh
left a comment
Collaborator
There was a problem hiding this comment.
Went through this one carefully. The end_stream parsing fast-path looks logically sound (I checked the NDJSON fallback — parseMessages appends to partial_message_, so newline splitting still works as the comment claims).
Two things I'd want resolved before this goes in: the captured session id isn't wired to anything, and the new parsing branch has no test coverage. Rest are smaller notes inline.
added 11 commits
July 23, 2026 08:00
Summary: - Return Mcp-Session-Id from HTTP/SSE dispatch contexts when no SSE callback session is active. - Add a real-IO server-mode regression test for Streamable HTTP POST /mcp session binding. Verification: - cmake --build build --target test_http_sse_filter_server_mode - ./build/tests/test_http_sse_filter_server_mode --gtest_filter='ServerModeFilterTest.*'
Summary: - Drop the unreachable case-insensitive Mcp-Session-Id scan because HTTP codec callbacks already receive lowercase header names. - Remove the now-unused cctype include. Verification: - ./build/tests/test_http_sse_filter_server_mode --gtest_filter='ServerModeFilterTest.StreamablePost_AnnouncesMcpSessionIdBinding:ServerModeFilterTest.PlainPost_AnnouncesEmptyBinding' - git diff --check
Summary: - Derive reconnect readiness wait from a bounded fraction of request_timeout so polling cannot consume the full request deadline. - Add deterministic client reconnection tests for default, medium, short, and very small request timeouts. Verification: - cmake --build build --target test_client_reconnection_and_logging - ./build/tests/test_client_reconnection_and_logging --gtest_filter='ClientReconnectionTest.*' - git diff --check
Summary: - Rename the runtime-derived reconnect retry count from kMaxReconnectRetries to max_reconnect_retries. - Update stale test commentary that referenced the old constant-style name. Verification: - cmake --build build --target test_client_reconnection_and_logging - ./build/tests/test_client_reconnection_and_logging --gtest_filter='ClientReconnectionTest.*' - git diff --check
Summary: - Add parser coverage for pretty-printed complete HTTP bodies, NDJSON fallback, and malformed end-stream input. - Exercise the end_stream non-framed branch used by Streamable HTTP request bodies. Verification: - cmake --build build --target test_json_rpc_protocol_filter - ./build/tests/test_json_rpc_protocol_filter --gtest_filter='JsonRpcProtocolFilterTest.EndStreamParsesPrettyPrintedBodyAsOneJson:JsonRpcProtocolFilterTest.EndStreamFallsBackToNdjsonBodies:JsonRpcProtocolFilterTest.EndStreamMalformedBodyReportsParseError' - git diff --check Note: - Full JsonRpcProtocolFilterTest.* run hit existing unrelated bind failure in SendResponseFailsOnClosedConnection.
Summary: - Add a parsed-message dispatch helper so parseMessage and complete HTTP body parsing share dispatch logic. - Dispatch end-stream single-document bodies from the parsed JsonValue instead of parsing the same payload twice. - Preserve JSON parse and internal error mapping for existing parser paths. Verification: - cmake --build build --target test_json_rpc_protocol_filter - ./build/tests/test_json_rpc_protocol_filter --gtest_filter='JsonRpcProtocolFilterTest.ParseRequest:JsonRpcProtocolFilterTest.ParseNotification:JsonRpcProtocolFilterTest.ParseResponse:JsonRpcProtocolFilterTest.ParseErrorResponse:JsonRpcProtocolFilterTest.InvalidJson:JsonRpcProtocolFilterTest.EndStreamParsesPrettyPrintedBodyAsOneJson:JsonRpcProtocolFilterTest.EndStreamFallsBackToNdjsonBodies:JsonRpcProtocolFilterTest.EndStreamMalformedBodyReportsParseError' - git diff --check
Summary: - Validate end-stream bodies as NDJSON before falling back from single-document parsing. - Report one PARSE_ERROR for malformed multi-line bodies instead of parsing each line fragment independently. - Add regression coverage for malformed pretty-printed JSON bodies. Verification: - cmake --build build --target test_json_rpc_protocol_filter - ./build/tests/test_json_rpc_protocol_filter --gtest_filter='JsonRpcProtocolFilterTest.ParseRequest:JsonRpcProtocolFilterTest.ParseNotification:JsonRpcProtocolFilterTest.ParseResponse:JsonRpcProtocolFilterTest.ParseErrorResponse:JsonRpcProtocolFilterTest.InvalidJson:JsonRpcProtocolFilterTest.EndStreamParsesPrettyPrintedBodyAsOneJson:JsonRpcProtocolFilterTest.EndStreamFallsBackToNdjsonBodies:JsonRpcProtocolFilterTest.EndStreamMalformedBodyReportsParseError:JsonRpcProtocolFilterTest.EndStreamMalformedPrettyBodyReportsOneParseError' - git diff --check
Summary: - Align changelog history with published gopher-mcp release notes. - Keep 0.1.14 focused on Streamable HTTP parsing, session id propagation, and reconnect timeout fixes. - Remove generated release bookkeeping and duplicated historical entries.
Summary: - Restore unchanged RequestLogger no-handler log lines to their original layout. - Keep the passthrough bugfix PR focused on behavior changes.
Summary: - Invoke the HTTP routing default handler before forwarding unmatched requests to protocol handling. - Return immediate JSON 404 responses for unknown HTTP/SSE server paths while preserving MCP, SSE, and callback transport pass-through. - Add routing unit tests and a server-mode integration regression test for unknown discovery paths.
dIvYaNshhh
approved these changes
Jul 23, 2026
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.
No description provided.