mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 10:34:35 -07:00
Add support for running available commands prior to MCP servers loading (#15596)
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
ToolErrorType,
|
||||
coreEvents,
|
||||
CoreEvent,
|
||||
MCPDiscoveryState,
|
||||
} from '@google/gemini-cli-core';
|
||||
import type {
|
||||
Config,
|
||||
@@ -951,6 +952,26 @@ export const useGeminiStream = (
|
||||
{ name: 'submitQuery' },
|
||||
async ({ metadata: spanMetadata }) => {
|
||||
spanMetadata.input = query;
|
||||
|
||||
const discoveryState = config
|
||||
.getMcpClientManager()
|
||||
?.getDiscoveryState();
|
||||
const mcpServerCount =
|
||||
config.getMcpClientManager()?.getMcpServerCount() ?? 0;
|
||||
if (
|
||||
!options?.isContinuation &&
|
||||
typeof query === 'string' &&
|
||||
!isSlashCommand(query.trim()) &&
|
||||
mcpServerCount > 0 &&
|
||||
discoveryState !== MCPDiscoveryState.COMPLETED
|
||||
) {
|
||||
coreEvents.emitFeedback(
|
||||
'info',
|
||||
'Waiting for MCP servers to initialize... Slash commands are still available.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const queryId = `${Date.now()}-${Math.random()}`;
|
||||
activeQueryIdRef.current = queryId;
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user