mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
fix(core): await MCP initialization in non-interactive mode (#17390)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user