fix(mcp): preserve structured-only federated tool results - #6456
Open
Ricky-7-Yan wants to merge 1 commit into
Open
fix(mcp): preserve structured-only federated tool results#6456Ricky-7-Yan wants to merge 1 commit into
Ricky-7-Yan wants to merge 1 commit into
Conversation
Signed-off-by: Ricky-7-Yan <2314530442@qq.com>
Ricky-7-Yan
requested review from
Lang-Akshay,
brian-hussey,
crivetimihai,
ja8zyjits and
msureshkumar88
as code owners
August 28, 2026 17:20
|
FWIW I have been running this patch successfully in my environment. Fixed the issue for me. |
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.
🐛 Bug-fix PR
📌 Summary
A successful federated
tools/callresult may carry all data instructuredContentwhilecontentis empty. The streamable-HTTP transport treated that valid shape as empty and returned before its existing structured-content handler.The guard now returns early only when both representations are absent. Structured-only results reach the existing tuple response path, while genuinely empty results keep returning
[].Closes #5472
🔁 Reproduction
outputSchema.{ "content": [], "structuredContent": { ... } }./mcpstreamable-HTTP endpoint.📏 Reviewability
triage🏷️ Type of Change
🧪 Verification
The new regression test was run before the source change and failed with
result == [].After the fix:
Ruff 0.15.20 passes for the changed source and the changed test while excluding two unrelated violations already present elsewhere in the 17k-line test module (
E303at line 9639 andPLC2801at line 17055). The source file passes formatting; the test module has two pre-existing formatting differences outside this change.✅ Checklist