Add AgentResourceResolver for RemoteHub virtual URI support in chat editing #260458
+59
−0
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 PR enables VS Code coding-agent chat editing sessions to edit files that are not in the local workspace by resolving remote targets to RemoteHub virtual (
vscode-vfs://
) URIs. This keeps the chat editing pipeline unchanged while leveraging RemoteHub's writable virtual filesystem.Problem
Currently, chat editing sessions can only work with local workspace files (
file://
URIs) or existing virtual files (vscode-vfs://
URIs). When agents want to edit remote repository files (e.g., from GitHub), there's no mechanism to resolve remote descriptors to writable virtual URIs.Solution
Introduces a minimal
IAgentResourceResolver
service that:file://
andvscode-vfs://
URIs are returned unchangedAgentTargetDescriptor
objects are resolved via RemoteHub'sremoteHub.createAgentVirtualUri
commandImplementation
New
agentResourceResolver.ts
:Integration in
ChatEditingSession._acceptEdits
:Benefits
Example Usage
The resolver is registered as a singleton and injected via DI into
ChatEditingSession
, making it available throughout the chat editing pipeline with no changes required to calling code.Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
electronjs.org
node-gyp
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.