Fix:Missing Structured Content for Virtual Server in Streamable HTTP Response #1412
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.
closing issue #1406
This pull request introduces improvements to the handling and processing of tool responses, particularly for structured content, and enhances logging for debugging and traceability. The changes ensure that both unstructured and structured outputs from tools are correctly normalized and returned, and that the code is robust against different field naming conventions and model types.
Tool response handling and normalization:
call_toolinstreamablehttp_transport.pyto return both unstructured and structured content when available, supporting both snake_case and camelCase field names for structured content. This allows downstream validation against output schemas.tool_service.py, enhanced extraction of structured content from tool responses by accepting bothstructuredContentandstructured_contentfields, improving compatibility with different model serialization formats.Unit test robustness:
test_streamablehttp_transport.pyto explicitly unsetstructured_contentand overridemodel_dumpon mocks, preventing accidental attribute leakage and ensuring test accuracy.