fix!: omit resultType for legacy protocol sessions#1038
Merged
Conversation
DaleSeo
force-pushed
the
fix/legacy-result-type
branch
4 times, most recently
from
July 23, 2026 22:42
7d19769 to
f5d2b12
Compare
DaleSeo
force-pushed
the
fix/legacy-result-type
branch
from
July 23, 2026 22:55
f5d2b12 to
071580d
Compare
DaleSeo
marked this pull request as ready for review
July 23, 2026 22:58
DaleSeo
commented
Jul 24, 2026
| impl Default for CallToolResult { | ||
| fn default() -> Self { | ||
| CallToolResult { | ||
| result_type: Some(ResultType::COMPLETE), |
Member
Author
There was a problem hiding this comment.
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(); | ||
| } |
Member
Author
There was a problem hiding this comment.
"resultType": "complete" gets striped out here for legacy clients.
jamadeo
approved these changes
Jul 24, 2026
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.
Fixes #1036
Motivation and Context
Stops emitting the SEP-2322
resultType: "complete"discriminator on responses to peers that negotiated a protocol version older than2026-07-28, restoring the historical wire shape for legacy sessions while keeping2026-07-28sessions spec-compliant.How Has This Been Tested?
Added integration tests
Breaking Changes
Yes, the
result_typefield on the eight legacy-visible result types changed fromResultTypetoOption<ResultType>. It's okay to make a breaking change before v3 is released.Types of changes
Checklist