Repository navigation
chat: add ToolCallResult.resultMetadata mirroring MCP CallToolResult._meta - #549
Merged
Merged
Conversation
…_meta Hosts rebuilding MCP App tool results from state had no place for the server's result _meta (ToolCallBase._meta is host/provider metadata), so app-only data was lost on reconstruction (microsoft/vscode#343243). Add optional resultMetadata to ToolCallResult, carried by the result confirmation reducer like structuredContent, and regenerate schemas and clients. Co-authored-by: Copilot <[email protected]>
Connor Peet (connor4312)
marked this pull request as draft
October 28, 2026 22:30
Connor Peet (connor4312)
marked this pull request as ready for review
October 28, 2026 23:33
roblourens
approved these changes
Oct 29, 2026
Martin Aeschlimann (aeschli)
approved these changes
Oct 29, 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.
Adds optional
resultMetadata?: Record<string, unknown>toToolCallResult, mirroring the_metafield of MCPCallToolResult(the same waystructuredContentmirrors MCPstructuredContent).Why
MCP Apps read app-only data from a tool result's
_meta. Hosts that rebuild an MCP App tool result from AHP state (e.g. when a session is reopened or restored) had nowhere to keep it.ToolCallBase._metais host/provider metadata (ui,toolKind, ...), so putting server-controlled data there risks collisions. Without the result metadata, restored MCP App cards lose their data: microsoft/vscode#343243.Changes
types/channels-chat/state.ts: new optionalToolCallResult.resultMetadata.types/channels-chat/reducer.ts: the result-confirmation path copiesresultMetadataalongsidestructuredContent. The native Swift, Rust, Kotlin, Go and .NET reducers do the same.Consumers
_metafrom the Copilot runtime.Validation
npm run generate: all targets regenerated.npm test: typecheck, lint, release-metadata, changelog/fragment and generated-freshness checks pass;types/reducers.tscoverage is 100%.scripts/read-window-exempt.test.tsandtypes/channel-delivery.test.tsfail ("Control Messages section must exist"). They fail the same way on unmodifiedmainwithcore.autocrlf=true, so this change doesn't cause them.Written by Connor's agent