From ac12f9152541f6032ddeb58f18d723ae4af5bce9 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 12 Jul 2026 01:51:24 +0900 Subject: [PATCH] Send required `initialize` params in the mutex probe test helper ## Motivation and Context `bundle exec rake` fails on main with four errors in `streamable_http_transport_test.rb`: ``` NoMethodError: undefined method '[]=' for nil streamable_http_transport_test.rb:5119 (install_mutex_probe_stream) ``` This is a semantic conflict between two merged PRs. #451 made the server reject `initialize` requests that lack the required `protocolVersion`, `capabilities`, and `clientInfo` params with -32602. #449, merged after but developed before it, added the "writes outside the mutex" tests, whose `initialize_test_session` helper sends an `initialize` request with no params. That request is now rejected, no session is created, so `@sessions[session_id]` is nil and installing the probe stream raises `NoMethodError`. The fix adds `params: initialize_params` to the helper's request body, matching the pattern used by every other `initialize` request in the file via `InitializeParamsTestHelper`. ## How Has This Been Tested? `bundle exec rake` now passes: 1318 runs, 0 failures, 0 errors, and RuboCop reports no offenses. The four previously failing tests are the regression coverage. ## Breaking Changes None. Test-only change. --- test/mcp/server/transports/streamable_http_transport_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mcp/server/transports/streamable_http_transport_test.rb b/test/mcp/server/transports/streamable_http_transport_test.rb index 5cb2b842..a285f6f1 100644 --- a/test/mcp/server/transports/streamable_http_transport_test.rb +++ b/test/mcp/server/transports/streamable_http_transport_test.rb @@ -5089,7 +5089,7 @@ def initialize_test_session(id: "init") "POST", "/", { "CONTENT_TYPE" => "application/json" }, - { jsonrpc: "2.0", method: "initialize", id: id }.to_json, + { jsonrpc: "2.0", method: "initialize", id: id, params: initialize_params }.to_json, ) @transport.handle_request(init_request)[1]["Mcp-Session-Id"] end