Skip to content

docs(schema): define receiver behavior for unknown v2 variants - #2500

Merged
benbrandt merged 1 commit into
mainfrom
docs/v2-unknown-variant-receiver-rules
Oct 26, 2026
Merged

benbrandt merged 1 commit into
mainfrom
docs/v2-unknown-variant-receiver-rules

Conversation

@benbrandt

Copy link
Copy Markdown
Member

v2 opens most discriminators so new and custom variants don't break older peers, but for unions on request paths it never said what the receiver does with a variant it can't act on. Implementations could silently ignore, reject or abort.

This keeps the unions open and adds one rule to extensibility.mdx: if a request can't be fulfilled without understanding an unknown variant, the receiver MUST reject it with -32602. Otherwise it degrades gracefully as the field documents, for example by ignoring the variant or displaying it generically.

Applied to each union that lacked a rule (doc pages and Rust doc comments, so the generated schema too):

Union Behavior
MCP server transport in session setup Reject unsupported transports with -32602; previously "ignore it or reject the server configuration"
session/set_config_option value type Reject unsupported types with -32602
Content block in session/prompt Reject unsupported types with -32602; in session/update it still degrades to ignore or generic display
ElicitationAction in a response Handle as cancel

The Enum Variant Extension RFD now says request-core unions can stay closed or be opened, and describes this behavior when they're open.

Main and draft v2 pages are updated together. No wire-format changes; only schema descriptions change.

Open unions stay open. If a request can't be fulfilled without
understanding an unknown variant, the receiver rejects it with -32602;
otherwise it degrades gracefully as the field documents.

Applied to the request-path unions that had no single rule:
- unsupported MCP server transport: reject
- unsupported session/set_config_option value type: reject
- unsupported content block in session/prompt: reject
- unknown elicitation action in a response: handle as cancel
@benbrandt
benbrandt requested a review from a team as a code owner October 26, 2026 22:03
@benbrandt
benbrandt enabled auto-merge (squash) October 26, 2026 22:05
@benbrandt
benbrandt merged commit 3860cb9 into main Oct 26, 2026
14 checks passed
@benbrandt
benbrandt deleted the docs/v2-unknown-variant-receiver-rules branch October 26, 2026 22:07
@acp-release-bot acp-release-bot Bot mentioned this pull request Oct 26, 2026
benbrandt added a commit that referenced this pull request Oct 27, 2026
…rvers (#2512)

The unsupported-transport rule from #2500 now names a transport the
Agent did not advertise and v1's `sse`. If a server fails to launch or
connect, the Agent either fails the request or continues without it and
should tell the user. The migration checklists say to reject SSE and
unadvertised transports, and to send only advertised transports.
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.

1 participant