Skip to content

fix: preserve legacy protocol result serialization#1042

Draft
tsarlandie-oai wants to merge 1 commit into
modelcontextprotocol:mainfrom
tsarlandie-oai:codex/rmcp-1036-legacy-result-serialization
Draft

fix: preserve legacy protocol result serialization#1042
tsarlandie-oai wants to merge 1 commit into
modelcontextprotocol:mainfrom
tsarlandie-oai:codex/rmcp-1036-legacy-result-serialization

Conversation

@tsarlandie-oai

Copy link
Copy Markdown

Summary

  • omit resultType: "complete" from responses for negotiated legacy sessions
  • preserve required result discriminators for modern sessions and discovery
  • keep negotiated session versions authoritative over conflicting request metadata
  • expose protocol-aware ServerResult serialization and adaptation methods

Why

Result serialization applied the modern discriminator without accounting for the protocol version negotiated by the session. Legacy clients can reject that wire shape even though the underlying result is otherwise valid.

This keeps modern behavior intact while restoring the legacy-compatible response format for ordinary tools, lists, resources, historical discovery, and actual wire responses.

Validation

  • comprehensive regression suite: 516 tests passed
  • whole-workspace formatting check passed
  • all-target, all-feature Clippy passed with the documented beta-only toolchain warning suppressed

Fixes #1036

@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes T-service Service layer changes labels Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-service Service layer changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rmcp 3.0 emits resultType: "complete" for legacy protocol sessions

1 participant