Add support for running available commands prior to MCP servers loading (#15596)

This commit is contained in:
Adib234
2026-01-15 15:33:16 -05:00
committed by GitHub
parent 8a627d6c9a
commit 1e8f87fbdf
7 changed files with 230 additions and 8 deletions

View File

@@ -796,12 +796,14 @@ export class Config {
this,
this.eventEmitter,
);
const initMcpHandle = startupProfiler.start('initialize_mcp_clients');
await Promise.all([
await this.mcpClientManager.startConfiguredMcpServers(),
await this.getExtensionLoader().start(this),
]);
initMcpHandle?.end();
// We do not await this promise so that the CLI can start up even if
// MCP servers are slow to connect.
Promise.all([
this.mcpClientManager.startConfiguredMcpServers(),
this.getExtensionLoader().start(this),
]).catch((error) => {
debugLogger.error('Error initializing MCP clients:', error);
});
if (this.skillsSupport) {
this.getSkillManager().setAdminSettings(this.adminSkillsEnabled);