fix(cli): make MCP ping optional in list command and use configured timeout#26068
fix(cli): make MCP ping optional in list command and use configured timeout#26068cocosheng-g merged 3 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the robustness of the MCP server listing functionality in the CLI. By making the ping check optional and utilizing configurable timeouts, it ensures better compatibility with various MCP server implementations, including Google's first-party servers, while providing more flexible connection management. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the MCP server connection logic to use configured or default timeouts and makes the ping test optional, allowing servers to be marked as connected even if the ping fails. Feedback suggests ensuring the ping call also respects the timeout for consistency and improving debug logging by passing the error object as a separate argument instead of using string interpolation.
Fixes #25599.
Changes:
ping()call ingemini mcp listis now optional. If it fails butconnect()succeeds, the server is reported as Connected. This fixes the "Disconnected" status for Google first-party MCP servers that don't implement ping.timeoutconfiguration if provided.connect()andping()now respect this timeout.debugLogger.debugto receive the error object separately, improving stack trace visibility in logs for easier troubleshooting.connectandping.