Fix WSL resource links in Agent Host chat responses - #333635
Merged
Dileep Yavanmandha (dileepyavan) merged 5 commits intoAug 31, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Dileep Yavanmandha (dileepyavan)
August 31, 2026 20:43
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.ts — The local Agent Host uses identityAgentHostResourceUriMapper, so this now returns internal… |
What changed in this PR
Routes Agent Host response links through the active connection’s resource URI mapper, fixing WSL-backed resources.
Changes:
- Use the connection mapper when rewriting links and images.
- Add WSL and link-preservation regression tests.
| File | Description |
|---|---|
agentHostSessionHandler.ts |
Passes the active resource mapper. |
stateToProgressAdapter.ts |
Maps parsed response targets. |
agentHostChatContribution.test.ts |
Tests WSL links, images, and preserved targets. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Benjamin Christopher Simmonds (benibenj)
previously approved these changes
Aug 31, 2026
Hawk Ticehurst (hawkticehurst)
previously approved these changes
Aug 31, 2026
Format default Markdown link hovers with the host-aware label service while preserving navigation targets and custom titles. Add coverage for WSL paths, Windows host formatting, and existing link behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dileep Yavanmandha (dileepyavan)
dismissed stale reviews from Hawk Ticehurst (hawkticehurst) and Benjamin Christopher Simmonds (benibenj)
via
August 31, 2026 21:00
f92d54f
Contributor
|
Base:
|
Dileep Yavanmandha (dileepyavan)
enabled auto-merge (squash)
August 31, 2026 21:45
Dmitriy Vasyura (dmitrivMS)
previously approved these changes
Aug 31, 2026
Dmitriy Vasyura (dmitrivMS)
approved these changes
Aug 31, 2026
Dileep Yavanmandha (dileepyavan)
deleted the
DileepY/wsl_markdown_links
branch
August 31, 2026 23:56
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.

Problem
File links and images in Agent Host chat responses can resolve against the local filesystem instead of the WSL filesystem when a locally identified session is backed by a WSL Agent Host connection.
The response URI resolver used the session handler's
connectionAuthorityto rewrite resource targets. That authority can remainlocaleven though the active connection's resource URI mapper points to WSL. In that case an absolute Linux path orfile:URI stays a local file URI rather than being routed through the owning Agent Host connection.Reproduction scenario
[file](/home/user/project/src/file.ts:42:7)or an image path in the WSL filesystem.Expected: Resolve through the WSL Agent Host connection, retaining the file path and line/column selection.
Actual before this fix: The target is interpreted as a local filesystem resource, so the intended WSL resource may not open or render.
Fix
resourceUrismapper fromAgentHostSessionHandler.resolveChatResponseUriintorewriteAgentHostLinkTarget.resourceUris.fromAgentHostrather than constructing their destination from the session authority alone.file:URIs, encoded image paths, and preservation of local, external, and already mapped links.Validation
response resource linkssuite inagentHostChatContribution.test.tsand therewriteAgentHostLinkTargetsuite instateToProgressAdapter.test.ts.git diff origin/main...HEAD --checkpassed../scripts/test.sh \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/stateToProgressAdapter.test.ts \ --grep 'response resource links|rewriteAgentHostLinkTarget'The WSL scenario is covered by unit regression tests; no end-to-end WSL UI validation was performed for this PR.