Skip to content

Fix streamable HTTP integration test API usage#20

Merged
0xeb merged 1 commit into
mainfrom
fix-streamable-http-tests
Dec 7, 2025
Merged

Fix streamable HTTP integration test API usage#20
0xeb merged 1 commit into
mainfrom
fix-streamable-http-tests

Conversation

@0xeb
Copy link
Copy Markdown
Owner

@0xeb 0xeb commented Dec 7, 2025

Summary

  • Fixed streamable_http_integration test that was incorrectly using StreamableHttpTransport::request() API
  • Test was passing full JSON-RPC envelopes as payload, causing double-wrapping
  • The request(route, payload) method expects route=method name, payload=params only

Root 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 of method: "initialize", so the server returned 400 (session required for non-initialize requests).

Changes

  • Fixed all 4 test functions to use the transport API correctly
  • Added exceptions.hpp include for TransportError type
  • Updated assertions to work with unwrapped result (not full envelope)

Test plan

  • All 59 fastmcpp tests pass locally
  • Claude Agent SDK C++ tests pass (147/147)
  • more_examples E2E tests pass

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.
@0xeb 0xeb merged commit ae90809 into main Dec 7, 2025
7 of 9 checks passed
@0xeb 0xeb deleted the fix-streamable-http-tests branch December 7, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant