fix(core): await MCP initialization in non-interactive mode (#17390)

This commit is contained in:
Ratish P
2026-01-23 22:51:47 +05:30
committed by GitHub
parent 488d5fc439
commit 4fc3ebb930
2 changed files with 40 additions and 5 deletions
+11 -3
View File
@@ -815,13 +815,21 @@ export class Config {
);
// We do not await this promise so that the CLI can start up even if
// MCP servers are slow to connect.
Promise.all([
const mcpInitialization = Promise.allSettled([
this.mcpClientManager.startConfiguredMcpServers(),
this.getExtensionLoader().start(this),
]).catch((error) => {
debugLogger.error('Error initializing MCP clients:', error);
]).then((results) => {
for (const result of results) {
if (result.status === 'rejected') {
debugLogger.error('Error initializing MCP clients:', result.reason);
}
}
});
if (!this.interactive) {
await mcpInitialization;
}
if (this.skillsSupport) {
this.getSkillManager().setAdminSettings(this.adminSkillsEnabled);
if (this.adminSkillsEnabled) {