Skip to content

fix(validation): accept extension result envelopes - #468

Merged
pcarleton merged 2 commits into
modelcontextprotocol:mainfrom
jstar0:fix/424-extension-result-validation
Sep 6, 2026
Merged

fix(validation): accept extension result envelopes#468
pcarleton merged 2 commits into
modelcontextprotocol:mainfrom
jstar0:fix/424-extension-result-validation

Conversation

@jstar0

@jstar0 jstar0 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Treat open resultType discriminators such as SEP-2663 task as extension results.
  • Validate extension results against the generic JSON-RPC result envelope until a versioned extension schema is available.
  • Add regression coverage for a task result returned from tools/call.

Verification

  • npm run build
  • npm test (44 test files, 525 tests passed)
  • npm run check (typecheck, ESLint, and Prettier)
  • Pre-push hook passed (format check and full test suite)

Fixes #424

jstar0 and others added 2 commits August 26, 2026 20:57
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>
@pkg-pr-new

pkg-pr-new Bot commented Sep 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/@modelcontextprotocol/conformance@468

commit: 49bea9e

@pcarleton pcarleton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pcarleton
pcarleton merged commit cf022cb into modelcontextprotocol:main Sep 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wire-schema validation rejects SEP-2663 task envelopes - no resultType "task" branch

2 participants