Skip to content

Commit ac12f91

Browse files
committed
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.
1 parent e81196e commit ac12f91

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎test/mcp/server/transports/streamable_http_transport_test.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5089,7 +5089,7 @@ def initialize_test_session(id: "init")
50895089
"POST",
50905090
"/",
50915091
{ "CONTENT_TYPE" => "application/json" },
5092-
{ jsonrpc: "2.0", method: "initialize", id: id }.to_json,
5092+
{ jsonrpc: "2.0", method: "initialize", id: id, params: initialize_params }.to_json,
50935093
)
50945094
@transport.handle_request(init_request)[1]["Mcp-Session-Id"]
50955095
end

0 commit comments

Comments
 (0)