Repository navigation
agentHost: fix empty client tool results - #320678
Merged
Connor Peet (connor4312) merged 1 commit intoJun 9, 2026
Merged
Conversation
Successful client tool calls now return a non-empty placeholder when they have no text content, while preserving embedded resources for the model. Fixes #315947 Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes client tool results sent from the Agent Host to the Copilot SDK so that successful tool calls always include a non-empty textResultForLlm, using '<empty />' when the tool returns no text (e.g., embedded-resource-only results). This addresses scenarios like screenshot tools where the primary output is binary.
Changes:
- Add an
EMPTY_TOOL_RESULT_TEXTplaceholder and apply it for successful client tool calls with empty/whitespace-only text content. - Preserve forwarding of embedded resources via
binaryResultsForLlmwhile still supplying placeholder text. - Expand unit tests to cover both “no content at all” and “embedded-resource-only” successful tool results.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Ensures successful client tool call completions provide non-empty textResultForLlm, with '<empty />' when needed, while still forwarding embedded resources. |
| src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts | Adds/updates assertions to validate placeholder text behavior and embedded-resource-only result forwarding. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
Michael Lively (Yoyokrazy)
approved these changes
Jun 9, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This ensures successful Copilot client tool calls always provide non-empty text to the SDK, using
<empty />when the tool only returns binary content or no text. Embedded resources are still forwarded unchanged so screenshots remain available to the model.Fixes #315947
Validation: