Skip to content

Fix web_fetch tool call showing empty content when expanded#311315

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-fetched-web-content-empty
Draft

Fix web_fetch tool call showing empty content when expanded#311315
Copilot wants to merge 3 commits intomainfrom
copilot/fix-fetched-web-content-empty

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

web_fetch tool 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 — Replace emptyInvocation with formatWebFetchInvocation() for web_fetch, setting invocationMessage"Fetching {url}" and pastTenseMessage"Fetched {url}"

  • copilotToolDisplay.ts — Add WebFetch cases to getInvocationMessage() and getPastTenseMessage() so the Agents App live session displays the URL instead of the generic Using "Web Fetch" fallback; add ICopilotWebFetchToolArgs interface. The URL is used as-is without truncation or markdown inline code wrapping.

  • copilotCLITools.spec.ts — Add test asserting web_fetch invocation includes the URL in its message

Copilot AI requested review from Copilot and removed request for Copilot April 20, 2026 06:21
Copilot AI linked an issue Apr 20, 2026 that may be closed by this pull request
- 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>
Copilot AI requested review from Copilot and removed request for Copilot April 20, 2026 06:43
Copilot AI changed the title [WIP] Fix agent app fetching empty web content issue Fix web_fetch tool call showing empty content when expanded Apr 20, 2026
Copilot AI requested a review from DonJayamanne April 20, 2026 06:44
case CopilotToolName.WebFetch: {
const args = parameters as ICopilotWebFetchToolArgs | undefined;
if (args?.url) {
return md(localize('toolInvoke.webFetch', "Fetching {0}", appendEscapedMarkdownInlineCode(truncate(args.url, 80))));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot there's no need to truncate this ,and no need to use appendEscapedMarkdownInlineCode, use the args.url as is

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot there's no need to truncate this ,and no need to use appendEscapedMarkdownInlineCode, use the args.url as is

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was already fixed in c7740fcgetPastTenseMessage also uses args.url directly without truncation or markdown wrapping.

Copy link
Copy Markdown
Contributor

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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>
Copilot AI requested review from Copilot and removed request for Copilot April 20, 2026 10:07
Copilot AI requested a review from DonJayamanne April 20, 2026 10:08
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 20, 2026

@copilot there's no need to truncate this ,and no need to use appendEscapedMarkdownInlineCode, use the args.url as is

Both getInvocationMessage and getPastTenseMessage were updated in c7740fc to use args.url as-is, with no truncation or appendEscapedMarkdownInlineCode wrapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agents App: Fetched web content empty

2 participants