From 8c68fcbc6933f10c63efb360d839f077b66345ee Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Mon, 19 Oct 2026 01:07:35 +0900 Subject: [PATCH] Expect no id in the refusal of an unreadable request id ## Motivation and Context The null id test of `test/mcp/server_test.rb` (#612) expects the refusal to carry `"id": null`, and the test of an id that is neither a string nor an integer (#613) only checks that `response[:id]` is nil. #615, merged after both, leaves the `id` member out of an error response whose request id cannot be read, so the first test fails on main (CI run 39142457575) and the second no longer pins the shape of the response. Both now expect a response without an `id` member; the library is unchanged. ## How Has This Been Tested? `test/mcp/server_test.rb`; against main the null id test fails as in CI. --- test/mcp/server_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/mcp/server_test.rb b/test/mcp/server_test.rb index 3c0870e0..7384c990 100644 --- a/test/mcp/server_test.rb +++ b/test/mcp/server_test.rb @@ -1942,7 +1942,7 @@ def read_resource_request(uri) response = @server.handle({ jsonrpc: "2.0", id: nil, method: "tools/call", params: { name: "count", arguments: {} } }) - assert_equal({ jsonrpc: "2.0", id: nil, error: { code: -32600, message: "Invalid Request", data: "Request ID must not be null" } }, response) + assert_equal({ jsonrpc: "2.0", error: { code: -32600, message: "Invalid Request", data: "Request ID must not be null" } }, response) assert_equal 0, calls end @@ -1996,7 +1996,7 @@ def read_resource_request(uri) [3.14, true, false, { a: 1 }, [1]].each do |id| response = @server.handle({ jsonrpc: "2.0", id: id, method: "ping" }) - assert_nil response[:id], id.inspect + refute response.key?(:id), id.inspect assert_equal(-32600, response[:error][:code], id.inspect) end end