Fix web_fetch tool call showing empty content when expanded#311315
Fix web_fetch tool call showing empty content when expanded#311315
Conversation
- Add formatWebFetchInvocation() in copilotCLITools.ts to show URL in invocationMessage/pastTenseMessage - Add web_fetch handling in copilotToolDisplay.ts getInvocationMessage/getPastTenseMessage - Add test for web_fetch invocation formatting Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/26446ad4-2529-41d2-b8c5-a3b073ef2a4b Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
| case CopilotToolName.WebFetch: { | ||
| const args = parameters as ICopilotWebFetchToolArgs | undefined; | ||
| if (args?.url) { | ||
| return md(localize('toolInvoke.webFetch', "Fetching {0}", appendEscapedMarkdownInlineCode(truncate(args.url, 80)))); |
There was a problem hiding this comment.
@copilot there's no need to truncate this ,and no need to use appendEscapedMarkdownInlineCode, use the args.url as is
There was a problem hiding this comment.
Done in c7740fc — removed the truncation and appendEscapedMarkdownInlineCode wrapping; now using args.url as-is for both getInvocationMessage and getPastTenseMessage.
| case CopilotToolName.WebFetch: { | ||
| const args = parameters as ICopilotWebFetchToolArgs | undefined; | ||
| if (args?.url) { | ||
| return md(localize('toolComplete.webFetch', "Fetched {0}", appendEscapedMarkdownInlineCode(truncate(args.url, 80)))); |
There was a problem hiding this comment.
@copilot there's no need to truncate this ,and no need to use appendEscapedMarkdownInlineCode, use the args.url as is
There was a problem hiding this comment.
This was already fixed in c7740fc — getPastTenseMessage also uses args.url directly without truncation or markdown wrapping.
DonJayamanne
left a comment
There was a problem hiding this comment.
@copilot there's no need to truncate this ,and no need to use appendEscapedMarkdownInlineCode, use the args.url as is
…L display Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/447cbe2f-991b-49d6-b7d3-a13da37dfe52 Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
web_fetchtool calls showed an empty expanded area during an active turn because both the VS Code extension and Agents App code paths lacked specific display handling — falling through to no-op or generic formatters that omit the URL entirely.Changes
copilotCLITools.ts— ReplaceemptyInvocationwithformatWebFetchInvocation()forweb_fetch, settinginvocationMessage→"Fetching {url}"andpastTenseMessage→"Fetched {url}"copilotToolDisplay.ts— AddWebFetchcases togetInvocationMessage()andgetPastTenseMessage()so the Agents App live session displays the URL instead of the genericUsing "Web Fetch"fallback; addICopilotWebFetchToolArgsinterface. The URL is used as-is without truncation or markdown inline code wrapping.copilotCLITools.spec.ts— Add test assertingweb_fetchinvocation includes the URL in its message