Fix streamable HTTP integration test API usage#20
Merged
Conversation
The test was incorrectly passing full JSON-RPC envelopes to transport.request(), which double-wrapped them. The request() method expects: - First arg: JSON-RPC method name (e.g., "initialize") - Second arg: Just the params object The method returns the unwrapped result (not full envelope). Fixed all 4 test functions to use the API correctly: - test_basic_request_response - test_session_management - test_server_info - test_error_handling Also added exceptions.hpp include for TransportError.
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
streamable_http_integrationtest that was incorrectly usingStreamableHttpTransport::request()APIrequest(route, payload)method expects route=method name, payload=params onlyRoot Cause
The test called:
transport.request("mcp", {full JSON-RPC envelope});But the API expects:
transport.request("initialize", {just the params});This caused the transport to create
method: "mcp"instead ofmethod: "initialize", so the server returned 400 (session required for non-initialize requests).Changes
exceptions.hppinclude forTransportErrortypeTest plan