fix(validation): accept extension result envelopes - #468
Merged
pcarleton merged 2 commits intoSep 6, 2026
Merged
Conversation
This fixes modelcontextprotocol#424 Signed-off-by: King Star <mcxin.y@gmail.com>
Restrict the generic-envelope fallback to resultType values a known extension defines (today: 'task', the tasks extension's CreateTaskResult). Any other non-core resultType is still validated as the request method's own result — the discriminator is open, so it may be a private extension — and a resulting violation names the unrecognised value so a typo or an unknown extension is obvious instead of silently passing envelope-only. Co-Authored-By: Claude <noreply@anthropic.com>
commit: |
pcarleton
approved these changes
Sep 6, 2026
pcarleton
left a comment
Member
There was a problem hiding this comment.
Thanks @jstar0. I pushed one small commit on top (49bea9e): only known extension resultTypes (today just "task") take the envelope-only path; any other unrecognised value is still validated as the method's result, with the value named in the failure.
@panyam @LucaButBoring FYI. Follow-ups I'd like your read on: whether "task" is the only value to allow-list for now, and making resultType a proper discriminator in the core schema (we likely need new a spec issue). #473's typed CreateTaskResult validation is something we can consider next.
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.
Summary
Verification
Fixes #424