Skip to content

fix: plugin skill files not accessible when connected to remote#309465

Open
cavalloJustinEmery wants to merge 3 commits intomicrosoft:mainfrom
cavalloJustinEmery:cavalloJustinEmery/305168
Open

fix: plugin skill files not accessible when connected to remote#309465
cavalloJustinEmery wants to merge 3 commits intomicrosoft:mainfrom
cavalloJustinEmery:cavalloJustinEmery/305168

Conversation

@cavalloJustinEmery
Copy link
Copy Markdown

@cavalloJustinEmery cavalloJustinEmery commented Apr 13, 2026

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/...) by getFilePath(). 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 _listExtensionPromptFiles command 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.tsgetFilePath() gains an isRemote parameter. When true and the URI scheme is file://, it returns a vscode-local:/ URI string instead of a native path. The remote extension host resolves vscode-local:/ URIs via the built-in local file bridge, which works transparently across SSH, WSL, and dev containers.

chatPromptFilesContribution.ts_listExtensionPromptFiles now includes PromptsStorage.plugin files alongside PromptsStorage.extension files. The IPC transport automatically rewrites their file:// URIs to vscode-local:/ as they cross the local/remote boundary, so the trust cache entries match what getFilePath() emits.

Testing

Unit tests cover the new getFilePath() behavior:

  • Returns a vscode-local:/ URI string for file:// URIs when isRemote=true (Linux and Windows remote OS)
  • No conversion when isRemote=false
  • No conversion for vscode-remote:// URIs even when isRemote=true

Fixes #305168

Copilot AI review requested due to automatic review settings April 13, 2026 13:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 return vscode-local:// URI strings for file:// URIs when running with a remote connection.
  • Include PromptsStorage.plugin prompt files in _listExtensionPromptFiles results 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.

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
@cavalloJustinEmery cavalloJustinEmery force-pushed the cavalloJustinEmery/305168 branch from 220fbab to d70afef Compare April 13, 2026 14:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

@cavalloJustinEmery
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Cavallo Solutions"

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.

Agent plugin skill files are inaccessible when connected to WSL/SSH remote

3 participants