microsoft / microsoft/vscode

Chat plugins: auto-discover worktree-root plugin.json in trusted worktree windows

Open
#327,348 2 comments 0 reactions 1 assignee Claimed by @connor4312 View on GitHub
feature-request
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Problem

I'm developing a VS Code agent plugin in a Git worktree, but VS Code doesn't appear to load the plugin from the active worktree. Instead it seems to resolve another copy/version of the plugin.

What is a work-tree-specific setup that allows VSCode to resolve plugin.json in the scope of each git work-tree directory?

## Worktree scenario

```text
repo.worktrees/
main/plugin.json
feature-a/plugin.json # branch-specific copy
feature-b/plugin.json # branch-specific copy
```

1. Create or detect multiple Git worktrees.
2. Run **Git: Open Worktree in New Window** and select `feature-a`.
3. The trusted worktree root contains `plugin.json`.
4. There is no worktree-local opt-in without a global user setting or absolute path.
5. Open `feature-b`; the desired source is now that worktree's root copy.

## Expected behavior

Support a worktree-local plugin source for trusted workspaces. For example:

- Detect `plugin.json` at each trusted workspace-folder root.
- Prompt once to enable it, or expose a workspace-local enablement toggle.
- Resolve components relative to that worktree root.
- Keep enablement isolated per workspace/worktree.
- Do not recursively load sibling worktrees or the parent worktree container.

## Related work

- #303853 requests workspace-scoped `chat.pluginLocations`.
- #315123 is an open PR changing it to `ConfigurationScope.WINDOW`.
- #308791 requests recursive discovery under a common parent.

This request is specifically worktree-root discovery/enablement. If #315123 is the intended solution, this scenario would be useful validation coverage and documentation.

## Screenshot

![VS Code worktree window showing the testing worktree root and its plugin.json](https://gist.githubusercontent.com/asilverman/0366d7a4b6e453eeb78dc9a303069d8c/raw/worktree-plugin-resolution.svg)

## Environment

- VS Code Insiders `1.131.0-insider`
- Commit `29215ba85809234979befc6b0d1fb4b0ab884383`
- Windows x64

## Current workaround

```jsonc
"chat.pluginLocations": {
".": true
}
```

This resolves per window, but globally opts every workspace into root plugin discovery rather than providing worktree-local enablement.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.