fix: plugin skill files not accessible when connected to remote#309465
Open
cavalloJustinEmery wants to merge 3 commits intomicrosoft:mainfrom
Open
fix: plugin skill files not accessible when connected to remote#309465cavalloJustinEmery wants to merge 3 commits intomicrosoft:mainfrom
cavalloJustinEmery wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes agent plugin skill file accessibility when connected to remote environments (SSH/WSL/dev containers) by emitting remote-readable identifiers for local skill files and ensuring plugin prompt files are included in the prompt-file listing used for trust caching.
Changes:
- Update
getFilePath()to optionally returnvscode-local://URI strings forfile://URIs when running with a remote connection. - Include
PromptsStorage.pluginprompt files in_listExtensionPromptFilesresults so downstream trust caching can cover them. - Add unit tests for the new
getFilePath()remote behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.ts | Adds isRemote handling to emit vscode-local:// for local file:// URIs in remote scenarios. |
| src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.ts | Extends _listExtensionPromptFiles to include plugin-stored prompt files. |
| src/vs/workbench/contrib/chat/test/common/promptSyntax/computeAutomaticInstructions.test.ts | Adds targeted tests validating getFilePath() behavior when isRemote is true/false and for vscode-remote:// URIs. |
src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.ts
Outdated
Show resolved
Hide resolved
When connected to an SSH/WSL/dev container remote, local file:// URIs for agent plugin skill files were being passed as native filesystem paths to the remote extension host, which can't read them. Fix getFilePath() to emit vscode-local:// URIs for local file:// paths when isRemote is true — the remote extension host can resolve these via the built-in local file bridge. Also fix _listExtensionPromptFiles to include plugin-storage files so they pass the trust check without triggering a confirmation dialog on every read. Fixes microsoft#305168
220fbab to
d70afef
Compare
src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/test/common/promptSyntax/computeAutomaticInstructions.test.ts
Outdated
Show resolved
Hide resolved
Author
|
@microsoft-github-policy-service agree company="Cavallo Solutions" |
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.
When connected to an SSH, WSL, or dev container remote, local
file://URIs for agent plugin skill files were being converted to native filesystem paths (e.g.C:\Users\...or/home/...) bygetFilePath(). The remote extension host can't read these paths — they only exist on the local machine — so skill files were silently inaccessible.Additionally, plugin-storage skill files were never included in the
_listExtensionPromptFilescommand result, so the copilot extension's trust cache never contained them. This caused a confirmation dialog to appear on every skill file read, even after the user had already granted trust.Changes
computeAutomaticInstructions.ts—getFilePath()gains anisRemoteparameter. Whentrueand the URI scheme isfile://, it returns avscode-local:/URI string instead of a native path. The remote extension host resolvesvscode-local:/URIs via the built-in local file bridge, which works transparently across SSH, WSL, and dev containers.chatPromptFilesContribution.ts—_listExtensionPromptFilesnow includesPromptsStorage.pluginfiles alongsidePromptsStorage.extensionfiles. The IPC transport automatically rewrites theirfile://URIs tovscode-local:/as they cross the local/remote boundary, so the trust cache entries match whatgetFilePath()emits.Testing
Unit tests cover the new
getFilePath()behavior:vscode-local:/URI string forfile://URIs whenisRemote=true(Linux and Windows remote OS)isRemote=falsevscode-remote://URIs even whenisRemote=trueFixes #305168