`resolveDiscoveredConfig` does not read workspace `.mcp.json` — `includeWorkspaceSources` never set
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 72/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- javascript
- Domínio
- cli
Direção de pesquisa
Comece em resolveDiscoveredConfig() e rastreie sua chamada para jv(), usando a reprodução fornecida de workingDirectory e workspace .mcp.json. Verifique se a descoberta de configuração inclui fontes do workspace; em seguida, execute novamente o cenário de sessão do SDK e confirme que o time MCP server é carregado de .mcp.json.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
});
- Linguagem predominante
- Shell
- Estrelas
- 11.2k
- Forks
- 1.9k
- Merge médio
- 14h 16min
- PRs com merge (30d)
- 6
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de github/copilot-cli
-
triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/copilot-cli#4848 ·
-
area:agents area:mcp
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/copilot-cli#4729 ·
-
area:sessions
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/copilot-cli#4712 ·
-
triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
github/copilot-cli#4638 ·
-
Expose large_output_file_path on TaskShellProgress so clients can read complete shell-task output Abertaarea:tools
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
github/copilot-cli#4630 · 1 comentário ·
Todas as issues de github/copilot-cli
Issues semelhantes
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
-
Update ghgrab to 2.1.0 Abertapackage-update
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 comentário ·
-
chore
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 91/100
alunduil/alunduil-chezmoi#792 ·
-
Accept -c in more positions Abertaarea: compat bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
zenhub-dev
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
OpenLiberty/ci.docker#747 ·