fix(core,cli,docs): harden IDE bootstrap, diagnostics, and connect timeout handling#22552
fix(core,cli,docs): harden IDE bootstrap, diagnostics, and connect timeout handling#22552Sangria-hbm wants to merge 10 commits intogoogle-gemini:mainfrom
Conversation
Add connect timeout guard for HTTP/stdio IDE transports to avoid indefinite /ide enable hangs. Add regression test for hanging connect path and keep CLI ide command test type-safe for workspace typecheck.
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 significantly enhances the robustness and user experience of the IDE integration by making connection processes more reliable and predictable. It addresses potential hanging issues, improves diagnostic feedback for disconnected states, and standardizes how IDE information is discovered and validated, ultimately leading to a more stable and user-friendly interaction with the Gemini CLI. Highlights
Changelog
Activity
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly hardens the IDE integration by introducing deterministic bootstrap behavior, connection timeouts to prevent hangs, and improved diagnostic messages. The changes span documentation, CLI commands, and core logic, providing a more reliable user experience. My review found one area for improvement in packages/core/src/ide/ide-client.ts where a redundant validation function can be removed to reduce code duplication and simplify the logic.
| client.currentIde = detectIde( | ||
| client.ideProcessInfo, | ||
| connectionConfig?.ideInfo, | ||
| parseIdeInfoFromConnectionFile(connectionConfig), | ||
| ); |
There was a problem hiding this comment.
The call to parseIdeInfoFromConnectionFile is redundant. The detectIde function already performs robust validation and normalization on the ideInfo object via normalizeIdeInfoFromFile.
You can simplify this by passing connectionConfig?.ideInfo directly and removing the now-unused parseIdeInfoFromConnectionFile function (lines 77-97).
| client.currentIde = detectIde( | |
| client.ideProcessInfo, | |
| connectionConfig?.ideInfo, | |
| parseIdeInfoFromConnectionFile(connectionConfig), | |
| ); | |
| client.currentIde = detectIde( | |
| client.ideProcessInfo, | |
| connectionConfig?.ideInfo as { name?: unknown; displayName?: unknown }, | |
| ); |
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383). We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'. This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community! |
Summary
Improve IDE integration reliability by making bootstrap behavior deterministic, improving disconnected diagnostics, and preventing
/ide enablefrom hanging when IDE transport connection never resolves.Details
ideInfodeterministically.ideInfoshape/blank values and fall back safely to env detection.noWorkspacePath,workspaceNotOpen,workspaceMismatch,connectFailed.GEMINI_IDE_CONNECT_TIMEOUT_MS, default10000ms) so hangs become disconnected failures./ide statusfallback naming and disconnected diagnostics rendering.Related Issues
Related to #15538
Historical context: #4800 (closed by #10501)
How to Validate
Automated:
Expected result:
Manual:
/ide enable, then/ide status./ide disable, then/ide enable./ide enableagain.Pre-Merge Checklist