Copilot Chat (Agents): folder picker defaults to alphabetically first repository in multi-repo workspace, no way to prefer workspace root
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Problem
In a workspace rooted at a single folder (not multi-root), where Git submodules are detected as additional repositories, starting a new Copilot Chat/Agents session shows a folder/repository picker. The picker appears to sort entries alphabetically and selects the first item by default.
In my case, that means a submodule (e.g. `ui/cengage`) is selected by default instead of the workspace root repo (`pim-www`).
## Why this is an issue
I want to keep submodule awareness enabled, but I still want new chat sessions to default to the workspace root repository unless I explicitly choose a submodule.
Currently, there seems to be no setting to do that.
## Repro
1. Open a repository folder as workspace root (example: `pim-www`).
2. Ensure submodule detection is enabled (`git.detectSubmodules: true`).
3. Have multiple detected repos (root + submodules).
4. Open a new Copilot Chat/Agents session.
5. Observe folder/repo picker default selection.
## Actual behavior
- Repo list appears sorted alphabetically.
- Default selection is the first entry (often a submodule), not workspace root.
## Expected behavior
One of:
1. Default to workspace root repo for new sessions, or
2. Remember last selected repo/folder per workspace, or
3. Provide a setting to control default selection strategy, e.g.:
- `workspaceRoot`
- `lastUsed`
- `alphabeticalFirst` (current behavior)
## What I already tried
- `git.autoRepositoryDetection: "openEditors"`
- `git.repositoryScanMaxDepth: 0`
- `git.scanRepositories: ["."]`
These did not change picker default behavior.
## Environment
- VS Code: 1.102.0
- Copilot Chat: Copilot CLI runtime in VS Code (Agents mode)
- OS: macOS
- Workspace type: single-root folder with Git submodules detected
Contributor guide
Assessment
This issue has not been assessed yet.