fix(core): complete MCP discovery when configured servers are skipped (#18586)

Co-authored-by: christine betts <chrstn@uw.edu>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Dmitry Lyalin
2026-02-11 11:30:46 -05:00
committed by GitHub
parent c202cf3145
commit f5dd1068f6
2 changed files with 46 additions and 0 deletions
@@ -337,6 +337,15 @@ export class McpClientManager {
this.maybeDiscoverMcpServer(name, config),
),
);
// If every configured server was skipped (for example because all are
// disabled by user settings), no discovery promise is created. In that
// case we must still mark discovery complete or the UI will wait forever.
if (this.discoveryState === MCPDiscoveryState.IN_PROGRESS) {
this.discoveryState = MCPDiscoveryState.COMPLETED;
this.eventEmitter?.emit('mcp-client-update', this.clients);
}
await this.cliConfig.refreshMcpContext();
}