`resolveDiscoveredConfig` does not read workspace `.mcp.json` — `includeWorkspaceSources` never set
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript
- Lĩnh vực
- cli
Hướng nghiên cứu
Bắt đầu từ resolveDiscoveredConfig() và lần theo lệnh gọi đến jv(), sử dụng bản tái hiện workingDirectory và workspace .mcp.json được cung cấp. Xác minh rằng quá trình phát hiện cấu hình bao gồm các nguồn của workspace, sau đó chạy lại kịch bản phiên SDK và xác nhận rằng time MCP server được tải từ .mcp.json.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When the SDK creates a session with enableConfigDiscovery: true and a workingDirectory, the CLI's resolveDiscoveredConfig() calls the internal MCP config loader (jv()) without passing includeWorkspaceSources: true. That parameter defaults to false, so the workspace .mcp.json is never read — even though the intent of enableConfigDiscovery is clearly to discover it.
Version
@github/copilot v1.0.41-0 (commit 3f18c2c)
Steps to reproduce
- Place a valid
.mcp.jsonin a working directory:{ "mcpServers": { "time": { "command": "uvx", "args": ["mcp-server-time"] } } } - Create a session via the SDK with
enableConfigDiscovery: trueandworkingDirectorypointing to that directory. - Observe that no MCP servers from
.mcp.jsonare discovered.
Expected behaviour
The MCP servers defined in the workspace .mcp.json should be discovered and loaded into the session.
Actual behaviour
The CLI logs:
Loaded MCP config from installed plugins: 0 server(s):
No MCP config loaded from ODR (ODR unavailable or returned no usable servers)
No workspace .mcp.json is read. The flag triggers config resolution, but the resolution skips the workspace source.
Root cause
In resolveDiscoveredConfig(), the call to jv() omits includeWorkspaceSources:
async resolveDiscoveredConfig(e) {
if (!e.enableConfigDiscovery) return {};
let r = e.workingDirectory || process.cwd();
// ...
let c = await jv({
cwd: r,
repoRoot: l,
settings: this.options.settings,
installedPlugins: s
// ← missing: includeWorkspaceSources: true
});
}
Inside jv(), the parameter defaults to false. When false, the function skips the code path that reads .mcp.json from the working directory:
async function jv(t = {}) {
let { includeWorkspaceSources: s = false } = t;
// ...
if (!s) d = { ...c }; // ← only copies global config
else {
// reads .mcp.json from cwd/repoRoot — this path is never taken
}
}
Suggested fix
Pass includeWorkspaceSources: true in the jv() call within resolveDiscoveredConfig():
let c = await jv({
cwd: r,
repoRoot: l,
settings: this.options.settings,
installedPlugins: s,
includeWorkspaceSources: true // ← add this
});
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/copilot-cli
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/copilot-cli#4848 ·
-
area:agents area:mcp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/copilot-cli#4729 ·
-
area:sessions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/copilot-cli#4712 ·
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
github/copilot-cli#4638 ·
-
Expose large_output_file_path on TaskShellProgress so clients can read complete shell-task output Đang mởarea:tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
github/copilot-cli#4630 · 1 bình luận ·
Tất cả issue của github/copilot-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
danielmiessler/LifeOS#2218 ·
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Update ghgrab to 2.1.0 Đang mởpackage-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
chore
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
alunduil/alunduil-chezmoi#792 ·