Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

Symbol links in chat output (e.g., "activate function") failed to open with "Unable to resolve resource" errors showing malformed URIs like c:%5CUsers%5C....

Root Cause

ChatResponseAnchorPart was constructed with SymbolInformation cast to any where VS Code expects Uri | Location, causing the chat UI to extract properties incorrectly.

// Before: Passing SymbolInformation where Uri | Location expected
const chatPart = new ChatResponseAnchorPart(part.symbolInformation as any);

Changes

File: src/extension/linkify/common/responseStreamWithLinkification.ts

  • Pass symbolInformation.location to constructor for the value property (backward compatible)
  • Set value2 property to full SymbolInformation for proper symbol rendering (proposed API)
// After: Proper type handling with proposed API support
const chatPart = new ChatResponseAnchorPart(part.symbolInformation.location);
(chatPart as any).value2 = part.symbolInformation;

This aligns with vscode.proposed.chatParticipantAdditions.d.ts where value2 supports Uri | Location | SymbolInformation.

Testing

Added responseStreamWithLinkification.spec.ts with tests covering:

  • Symbol anchors set both value (Location) and value2 (SymbolInformation)
  • Regular location anchors continue working without value2
Original prompt

This section details on the original issue you should resolve

<issue_title>Unable to open file resource from chat output</issue_title>
<issue_description>Found while testing microsoft/vscode#280380, though mostly unrelated to the TPI

  • Use Copilot Chat to support me while I work on the TPI
  • It provides a link so that I can specifically look at the activate function in my code
  • ❓ Link doesn't resolve
Image Image Image

Attaching logs from Show Logs above: Dec 2 logs 1.txt</issue_description>

Comments on the Issue (you are @copilot in this section)

@bamurtaugh The other links below in the chat output do open properly:

Image</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Changed ChatResponseAnchorPart creation for symbol anchors to use location instead of full SymbolInformation in the value property
- Added value2 property with the full SymbolInformation for proper symbol link rendering in VS Code
- Added comprehensive unit tests to validate the fix

This resolves the issue where clicking on symbol links like "activate function" would fail with "Unable to resolve resource" errors on Windows due to improper URI handling.

Co-authored-by: vijayupadya <[email protected]>
Copilot AI changed the title [WIP] Fix link resolution for file resource in chat output Fix symbol anchor rendering by using Location instead of SymbolInformation in value property Jan 17, 2026
Copilot AI requested a review from vijayupadya January 17, 2026 18:04
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.

Unable to open file resource from chat output

2 participants