-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Open
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalitypriority/p0Critical and urgent (e.g., critical security vulnerability, major breakage).Critical and urgent (e.g., critical security vulnerability, major breakage).status/possible-duplicate
Description
What happened?
The addOrUpdateServer() method in packages/core/src/tools/mcp-client-manager.ts has an unhandled promise rejection issue. When errors occur during MCP client initialization (e.g., in the McpClient constructor or disconnect method), they are not properly caught, leading to unhandled promise rejections that can crash the Node.js process.
The Promise constructor receives a _reject parameter that is never used, and the async IIFE has no .catch() handler, causing errors thrown before the try block to become unhandled rejections.
What did you expect to happen?
Errors during MCP server initialization should be caught and handled gracefully. Specifically:
- Errors should be logged with clear error messages via coreEvents.emitFeedback
- One MCP server failure should not prevent other servers from starting
- The Node.js process should not crash with UnhandledPromiseRejectionWarning
- Users should see helpful error messages indicating which server failed and why
Client information
Client Information
Platform: Linux (WSL2)
Run gemini to enter the interactive CLI, then run the /about command.
> /about
Gemini CLI v0.21.0-nightly.20251207.025e450ac
Node.js: v20.19.3
OS: Linux 6.6.87.2-microsoft-standard-WSL2Login information
No response
Anything else we need to know?
No response
Metadata
Metadata
Assignees
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalitypriority/p0Critical and urgent (e.g., critical security vulnerability, major breakage).Critical and urgent (e.g., critical security vulnerability, major breakage).status/possible-duplicate