Repository navigation
Conversation
koic
reviewed
Dec 4, 2026
| Methods::NOTIFICATIONS_PROGRESS => ->(_) {}, | ||
| Methods::NOTIFICATIONS_ROOTS_LIST_CHANGED => ->(_) {}, | ||
| Methods::COMPLETION_COMPLETE => ->(_) { DEFAULT_COMPLETION_RESULT }, | ||
| Methods::COMPLETION_COMPLETE => ->(_) {}, |
Member
There was a problem hiding this comment.
Nothing reads DEFAULT_COMPLETION_RESULT after this change. Could it be removed in this pull request as well?
Contributor
Author
There was a problem hiding this comment.
Good catch, thanks. Removed it in 6dd455e, and noted the removal of the public constant under Breaking Changes in the description.
Normalize missing and malformed handler results through the regular empty-completion path, which builds a new completion Hash and values Array for each call. Remove the `DEFAULT_COMPLETION_RESULT` constant, which nothing reads any more. Fixes modelcontextprotocol#752.
yorzi
force-pushed
the
fix/isolated-default-completion-results
branch
from
December 5, 2026 01:57
7aee334 to
6dd455e
Compare
This branch has not been deployed
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.
Motivation and Context
The default
completion/completeresult was theDEFAULT_COMPLETION_RESULTconstant itself, whose nestedcompletionHash andvaluesArray are not frozen, so every server in the process handed out the same objects.The built-in handler now returns
nil, andnormalize_completion_resultbuilds the empty result forniland for any other result without a completion Hash, the same way it builds a result from a handler's values. Each response gets new objects. Nothing readsDEFAULT_COMPLETION_RESULTany more, so it is removed.Fixes #752
How Has This Been Tested?
test/mcp/server_test.rb: the tests for the default result and for a handler that returnsnilnow send the request twice and check that the responses do not share thecompletionHash or thevaluesArray. The expected responses are unchanged.main.NameError).bundle exec rakepasses on Ruby 4.0.10 (RuboCop, 2857 runs with 0 failures, and the conformance baseline).yard --no-outputpasses.Breaking Changes
The responses have the same value; only their identity changes.
MCP::Server::DEFAULT_COMPLETION_RESULTis removed. It was not documented, but it was a public constant in 0.11.0 through 0.13.0, so code that refers to it directly must define its own value.Types of changes
Checklist