Gate application result fields by protocol version - #1816
Open
KirschBluteX wants to merge 2 commits into
Open
Conversation
sitihawa140492-byte
approved these changes
Aug 13, 2026
KirschBluteX
force-pushed
the
fix/protocol-result-gating-1754
branch
from
August 14, 2026 19:04
08e678b to
ad347ea
Compare
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.
Fixes #1754.
Summary
Add a single typed response-emission boundary after handlers and filters for protocol-version-specific result properties.
resultTypeand, for cacheable results,ttlMsandcacheScope, and emit a warning when application or filter code supplied them.complete,0, andprivate).McpServerOptions.RequestHandlersare intentionally outside this typed boundary; they return already-serialized JSON and the existing API contract defines them as bypassing typed handler infrastructure.The policy is strip plus warning: it keeps legacy wire responses schema-valid and makes application misuse visible, following the SDK's existing compatibility-warning convention without converting otherwise valid requests into errors.
Tests
ModelContextProtocol.slnxRelease build: 0 warnings, 0 errors.Execution!=Manual, net10.0): 2,360 passed, 4 skipped, 0 failed.Execution!=Manual, net10.0): 616 passed, 30 skipped, 0 failed.git diff --checkand targeteddotnet format --verify-no-changespassed for all changed files.trigger-sampling-requesttool and fails before the SDK sampling handler; the currentv1image exposessampleLLM. A diagnostic rerun with only that tool name updated passed both Docker tests (2/2); no unrelated fixture change is included here.action_requiredpending maintainer approval; they were not rerun.The branch is rebased onto upstream
mainat8754e19(the stateless protocol-span fix); that change does not alter the result-emission boundary.