mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 05:55:17 -07:00
Allow prompt queueing during MCP initialization (#17395)
This commit is contained in:
@@ -279,6 +279,7 @@ export class McpClientManager {
|
||||
if (currentPromise === this.discoveryPromise) {
|
||||
this.discoveryPromise = undefined;
|
||||
this.discoveryState = MCPDiscoveryState.COMPLETED;
|
||||
this.eventEmitter?.emit('mcp-client-update', this.clients);
|
||||
}
|
||||
})
|
||||
.catch(() => {}); // Prevents unhandled rejection from the .finally branch
|
||||
@@ -307,6 +308,12 @@ export class McpClientManager {
|
||||
this.cliConfig.getMcpServerCommand(),
|
||||
);
|
||||
|
||||
if (Object.keys(servers).length === 0) {
|
||||
this.discoveryState = MCPDiscoveryState.COMPLETED;
|
||||
this.eventEmitter?.emit('mcp-client-update', this.clients);
|
||||
return;
|
||||
}
|
||||
|
||||
// Set state synchronously before any await yields control
|
||||
if (!this.discoveryPromise) {
|
||||
this.discoveryState = MCPDiscoveryState.IN_PROGRESS;
|
||||
|
||||
Reference in New Issue
Block a user