Repository navigation
Fix remote chat plugin paths - #326916
Fix remote chat plugin paths#326916Martin Aeschlimann (aeschli) merged 19 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Preserves remote URI schemes and authorities when resolving configured plugin and skill paths.
Changes:
- Resolves absolute, tilde, and enterprise plugin paths against remote user homes.
- Applies equivalent handling to Copilot skill locations.
- Adds Remote WSL regression tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
agentPluginServiceImpl.ts |
Preserves remote identity for plugin paths. |
configuredAgentPluginDiscovery.test.ts |
Tests remote plugin path resolution. |
customInstructionsService.ts |
Updates configured skill resolution. |
skillConfigLocations.ts |
Preserves remote identity for shared skill locations. |
skillConfigLocations.spec.ts |
Tests remote skill paths. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts:684
URI.filenormalizes according to the client OS, not the remote OS. For example, from a Linux/macOS client connected to a Windows SSH host,URI.file('C:\\plugins')keeps the backslashes and produces a path that does not begin with/; transplanting it onto the non-empty remote authority then throws URI validation instead of discovering the plugin.IPathService.fileURI()is specifically documented to use the target environment's path rules (pathService.ts:20-52); use it (and then preserve the remote identity) rather thanURI.filefor remote absolute paths.
const uri = URI.file(path);
return [userHome.scheme === Schemas.file ? uri : userHome.with({ path: uri.path })];
|
Brandon H ***@***.***>於 2026年7月23日週四,00:23寫道:
… ***@***.**** commented on this pull request.
------------------------------
In src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts
<#326916 (comment)>:
> const idMatch = id.match(/^([^@/\\~]+)@([^@/\\~]+)$/);
if (!idMatch) {
return undefined;
}
const [, plugin, marketplace] = idMatch;
- return URI.file(`${userHome}/.copilot/installed-plugins/${marketplace}/${plugin}`);
+ return joinPath(userHome, '.copilot', 'installed-plugins', marketplace, plugin);
Accepted. Added regression coverage for enterprise plugin IDs resolved
from remote user homes to preserve the remote scheme and authority.
—
Reply to this email directly, view it on GitHub
<#326916?email_source=notifications&email_token=BYJ5DKCJN23CKO2NZXCAIBL5GDS6VA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINZVGY2DINRXGMYKM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussion_r3631913589>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BYJ5DKDMN7R6PQPMNBWMCZL5GDS6VAVCNFSNUABEKJSXA33TNF2G64TZHM2DCOBYGE4TAMB3JFZXG5LFHM2DSNBVGY2DIOJYGKQXMAQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
2fcd83b to
6251d77
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts:679
- The tilde branch still normalizes with
URI.file, which uses the client OS. On a Linux/macOS client connected to a Windows SSH target,~\pluginstherefore retains backslashes in the remote URI even though the absolute-path branch correctly usesIPathService.fileURIfor target-OS normalization. Normalize the expanded tilde path through the path service as well before restoring the home scheme/authority.
return [userHome.with({ path: URI.file(untildify(path, userHome.path)).path })];
Preserve remote URI scheme and authority for configured plugin and skill locations. Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Only expand valid tilde path forms so other names beginning with tilde remain workspace-relative. Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Co-authored-by: Copilot <[email protected]>
6a0f13f to
183afc4
Compare
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: TylerLeonhardtMatched files:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (5)
src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts:685
- When the remote target is Windows and
pathis a UNC location,fileURI()returns the server name inuri.authority(seepathService.ts:194-204). Replacing only the path therefore turns\\server\share\plugininto<remote>/share/plugin, silently droppingserver. Preserve the UNC authority as the leading//serverportion of the remote path before applying the remote connection authority.
return [userHome.scheme === Schemas.file ? uri : userHome.with({ path: uri.path })];
extensions/copilot/src/platform/customInstructions/common/customInstructionsService.ts:257
- For a UNC skill location on a remote Windows host,
URI.file(location)stores the file server inuri.authority. This branch discards that value and resolves\\server\share\skillsas<remote>/share/skills. Encode the UNC server into the remote URI path while retaining the remote connection authority.
const uri = URI.file(location);
configSkillLocationUris.push(locationRoot.scheme === Schemas.file ? uri : locationRoot.with({ path: uri.path }));
extensions/copilot/src/extension/chatSessions/common/skillConfigLocations.ts:44
- For a UNC skill location on a remote Windows host,
URI.file(location)stores the file server inuri.authority. Applying onlyuri.pathloses that server and points at<remote>/share/skillsinstead of\\server\share\skills. Preserve the UNC server in the remote URI path.
const uri = URI.file(location);
results.push(locationRoot.scheme === Schemas.file ? uri : locationRoot.with({ path: uri.path }));
extensions/copilot/src/platform/customInstructions/common/customInstructionsService.ts:244
- This infers the remote authority only from workspace folders. In a Remote WSL/SSH window with no folder open,
getWorkspaceFolders()returns[](workspaceServiceImpl.ts:66-67), so configured absolute and tilde locations still becomefile:URIs and cannot match remote skill resources. Use a source of the window's remote URI identity that is available independently of workspace folders.
const locationRoot = userHome.scheme === Schemas.file
? workspaceFolders.find(folder => folder.scheme === Schemas.vscodeRemote) ?? userHome
: userHome;
extensions/copilot/src/extension/chatSessions/common/skillConfigLocations.ts:34
- This fallback still returns
file:URIs in an empty Remote WSL/SSH window becausegetWorkspaceFolders()returns[]when no folder is open (workspaceServiceImpl.ts:66-67). Absolute and tilde configured locations should retain the remote identity even in an empty window; derive it from a service that exposes the window's remote URI independently of workspace folders.
const locationRoot = userHome.scheme === Schemas.file
? workspaceFolders.find(folder => folder.scheme === Schemas.vscodeRemote) ?? userHome
: userHome;
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
Co-authored-by: Copilot App <[email protected]> Copilot-Session: a709d3d4-1ecd-44ce-89bc-c343a6e47285
…onh-msft-fix-chat-plugin-paths # Conflicts: # src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts:680
- Using
userHome.pathdrops the authority of a local UNC home. For example,file://server/share/userexpands~/pluginsfrom/share/user, so the plugin is looked up on the local drive instead of\\server\share\user\plugins; the previousfsPathconversion preserved this. UsefsPathforfilehomes andpathfor remote homes before callinguntildify.
const uri = await this._pathService.fileURI(untildify(path, userHome.path));
Co-authored-by: Copilot <[email protected]>
|
failures appear to be transient. LMK if you disagree Christof Marti (@chrmarti) / TylerLeonhardt |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts:683
- When the local user home is itself a UNC URI, expanding from
userHome.pathdrops its server authority. For example,file://server/share/homeplus~/pluginsbecomesfile:///share/home/pluginsbecause_toTargetResourcereturns local file URIs unchanged. Restore the home authority for this tilde-derived local URI (or join directly ontouserHome).
const uri = await this._pathService.fileURI(untildify(path, userHome.path));
return [this._toTargetResource(uri, userHome)];
|
Tested on WSL. Thanks Brandon H (@brandonh-msft) ! |
who else needs to approve? |
3037131
into
microsoft:main
Configured plugin locations currently rebuild absolute paths as
file:URIs, which makes them inaccessible when the workspace is remote. Preserve the user-home URI scheme and authority for absolute and tilde locations so Remote WSL and SSH paths resolve through the remote file service.Fixes: #301167