Skip to content

fix!: omit resultType for legacy protocol sessions#1038

Merged
DaleSeo merged 1 commit into
mainfrom
fix/legacy-result-type
Jul 24, 2026
Merged

fix!: omit resultType for legacy protocol sessions#1038
DaleSeo merged 1 commit into
mainfrom
fix/legacy-result-type

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Jul 23, 2026

Copy link
Copy Markdown
Member

Fixes #1036

Motivation and Context

Stops emitting the SEP-2322 resultType: "complete" discriminator on responses to peers that negotiated a protocol version older than 2026-07-28, restoring the historical wire shape for legacy sessions while keeping 2026-07-28 sessions spec-compliant.

How Has This Been Tested?

Added integration tests

Breaking Changes

Yes, the result_type field on the eight legacy-visible result types changed from ResultType to Option<ResultType>. It's okay to make a breaking change before v3 is released.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@github-actions github-actions Bot added T-test Testing related changes T-config Configuration file changes T-core Core library changes T-handler Handler implementation changes T-macros Macro changes labels Jul 23, 2026
@DaleSeo DaleSeo changed the title fix: omit resultType for legacy protocol sessions fix!: omit resultType for legacy protocol sessions Jul 23, 2026
@DaleSeo
DaleSeo force-pushed the fix/legacy-result-type branch 4 times, most recently from 7d19769 to f5d2b12 Compare July 23, 2026 22:42
@DaleSeo
DaleSeo force-pushed the fix/legacy-result-type branch from f5d2b12 to 071580d Compare July 23, 2026 22:55
@DaleSeo
DaleSeo marked this pull request as ready for review July 23, 2026 22:58
@DaleSeo
DaleSeo requested a review from a team as a code owner July 23, 2026 22:58
@DaleSeo DaleSeo self-assigned this Jul 23, 2026
Comment thread crates/rmcp/src/model.rs
impl Default for CallToolResult {
fn default() -> Self {
CallToolResult {
result_type: Some(ResultType::COMPLETE),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

With Option, a handler could manually set result_type: None and ship a 2026-07-28 response missing a required field. The MUST is now guaranteed by convention instead since constructors always produce Some(COMPLETE).

// legacy wire shape without `resultType: "complete"`.
if !sep_2322_supported {
result.strip_result_type_for_legacy_peer();
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

"resultType": "complete" gets striped out here for legacy clients.

@DaleSeo
DaleSeo merged commit 6839cfd into main Jul 24, 2026
22 checks passed
@DaleSeo
DaleSeo deleted the fix/legacy-result-type branch July 24, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-config Configuration file changes T-core Core library changes T-handler Handler implementation changes T-macros Macro 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

2 participants