FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: disambiguate input-required results with metadata by DaleSeo · Pull Request #1103 · modelcontextprotocol/rust-sdk · GitHub

fix: disambiguate input-required results with metadata - #1103

Merged
DaleSeo merged 1 commit into
mainfrom
fix-input-required-meta
Aug 3, 2026
Merged

fix: disambiguate input-required results with metadata#1103
DaleSeo merged 1 commit into
mainfrom
fix-input-required-meta

Conversation

DaleSeo commented Jul 30, 2026
edited
Loading

Copy link
Copy Markdown
Member

Fixes #1094.

Motivation and Context

ServerResult is an untagged Serde union, and CallToolResult comes before InputRequiredResult. Since the CallToolResult deserializer accepted _meta without checking resultType, an intermediate result with metadata was incorrectly treated as an empty, completed tool call. As a result, its input requests and request state were dropped.

This PR prevents metadata-bearing InputRequiredResult values from being silently deserialized as completed tool results. It preserves legacy tool results that don't include resultType and adds regression coverage for both wire formats.

How Has This Been Tested?

Added coverage

Breaking Changes

None.

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 Bot added T-test Testing related changes T-core Core library changes labels Jul 30, 2026
DaleSeo marked this pull request as ready for review July 30, 2026 23:39
DaleSeo requested a review from a team as a code owner July 30, 2026 23:39
DaleSeo self-assigned this Jul 31, 2026
DaleSeo force-pushed the fix-input-required-meta branch from eb49261 to 889477a Compare July 31, 2026 15:10
DaleSeo merged commit 684ff5a into main Aug 3, 2026
22 checks passed
DaleSeo deleted the fix-input-required-meta branch August 3, 2026 16:55
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

Labels

T-core Core library changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InputRequiredResult with _meta silently deserializes as CallToolResult

2 participants


Back | FazBrowse Home | New Git URL