Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Add vscode-chat-response-resource:// URIs to allowlist to fix chat response resource reads#5056

Closed
Bestra wants to merge 1 commit into
microsoft:mainfrom
Bestra:fix/chat-response-resource-read-allowlist
Closed

Add vscode-chat-response-resource:// URIs to allowlist to fix chat response resource reads#5056
Bestra wants to merge 1 commit into
microsoft:mainfrom
Bestra:fix/chat-response-resource-read-allowlist

Conversation

@Bestra
Copy link
Copy Markdown

@Bestra Bestra commented Apr 10, 2026

In microsoft/vscode#308877 we're running into a problem where the resources from the GitHub MCP server (specifically for copilot spaces) come in under URIs like: vscode-chat-response-resource://...

These aren't part of the allowlist for readonly files so the model can't access them.

Summary

  • centralize the read-only allowlist for URIs that are readable without workspace membership
  • allow vscode-chat-response-resource URIs through both read-file access checks
  • add regressions for unopened chat response resource reads

Testing

  • npx vitest run src/extension/tools/node/test/toolUtils.spec.ts
  • npx vitest run src/extension/tools/node/test/readFile.spec.tsx -t "reads chat response resources without requiring an open tab"

I also tested this locally in my Insiders instance using the launch copilot extension run and debug.
CleanShot 2026-05-13 at 14 32 49@2x

and it works swimmingly.

CleanShot 2026-05-13 at 14 30 24@2x

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Bestra Bestra changed the title Fix chat response resource reads Add vscode-chat-response-resource:// URIs to allowlist to fix chat response resource reads Apr 10, 2026
@Bestra
Copy link
Copy Markdown
Author

Bestra commented Apr 10, 2026

I'll try this out locally before undrafting

@Bestra Bestra marked this pull request as ready for review May 13, 2026 18:33
Copilot AI review requested due to automatic review settings May 13, 2026 18:33
@Bestra
Copy link
Copy Markdown
Author

Bestra commented May 13, 2026

I've tested this out on my machine and it works, i've added a screenshot to the description. I think this is ready for review.

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

Centralizes the read-only allowlist logic in assertFileOkForTool and isFileExternalAndNeedsConfirmation into a shared helper, and adds vscode-chat-response-resource:// URIs to the allowlist so chat response resources (e.g. from GitHub MCP server for Copilot Spaces) can be read without requiring an open editor tab.

Changes:

  • Extract allowlist checks into a single isUriAllowedWithoutWorkspaceMembership helper used by both access-check functions.
  • Allow vscode-chat-response-resource scheme through read-only access checks.
  • Add unit tests for the new behavior in toolUtils.spec.ts and readFile.spec.tsx.
Show a summary per file
File Description
src/extension/tools/node/toolUtils.ts Adds shared allowlist helper and routes both access-check entry points through it; allows vscode-chat-response-resource for read-only.
src/extension/tools/node/test/toolUtils.spec.ts Adds regression tests for chat response resource allowlisting in read-only vs non-read-only mode.
src/extension/tools/node/test/readFile.spec.tsx Adds regression that ReadFileTool.prepareInvocation works for chat response resources without an open tab.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0

@Bestra
Copy link
Copy Markdown
Author

Bestra commented May 19, 2026

Closing this PR, this has been fixed 🙇 microsoft/vscode@19d4617

@Bestra Bestra closed this May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants