github / github/copilot-cli

Support multi-root workspaces via .code-workspace file for additional folder context and instruction files

未关闭
#1,826 4 条评论 16 个 reaction 已指派 0 人 在 GitHub 查看
area:configuration area:context-memory
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the feature or problem you'd like to solve

When using the Copilot CLI connected to a VS Code IDE workspace (via /ide), the CLI does not read the .code-workspace file to discover additional root folders. This means: 1. Instruction files (e.g., AGENTS.md) in additional workspace folders are not discovered or loaded 2. File context from additional workspace folders is not available for search/indexing — the agent only sees the primary cwd/git-root 3. Workspace settings like github.copilot.chat.codeGeneration.instructions that reference files in additional folders are not applied The VS Code extension handles this correctly — it reads all root folders from the .code-workspace file and includes their context and instruction files. Example Given this productivity.code-workspace: { "folders": [ { "path": "." }, { "path": "../../repos/TeamCerebro" }, { "path": "../../../../projects/XSPM-PostureEffectivenessScore" } ], "settings": { "github.copilot.chat.codeGeneration.instructions": [ { "file": "AGENTS.md" } ] } } The VS Code Copilot Chat extension indexes all 3 folders and loads the AGENTS.md instruction file. The CLI only sees the primary folder (cwd).

### Proposed solution

When connected to a VS Code IDE workspace via /ide:

1. Read the .code-workspace file to discover all root folders
2. Include instruction files from all workspace roots (respecting the same discovery rules: AGENTS.md, .github/copilot-instructions.md, etc.)
3. Make all workspace folders available for file search/context (same as the extension does)

Alternatively, support a CLI flag or config option like --workspace for standalone use without /ide.

### Example prompts or workflows

The agent can manually read the .code-workspace file, resolve the relative paths, and access the additional folders — but this requires explicit manual navigation rather than automatic discovery

### Additional context

- Related: #713 (instruction file discovery gaps)
- Related: #1559 (multi-workspace /ide confusion with git worktrees)
- OS: Windows 11
- CLI version:
0.0.421
- Connected via /ide to VS Code with multi-root workspace

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。