Repository navigation
fix(core,cli): prevent silent multi-minute loading hangs on network failures - #30182
Conversation
…ailures - Pass abortSignal to retryWithBackoff in BaseLlmClient so user cancellation immediately aborts backoff sleeps and prevents background retries. - Cap optional pre-turn auto-routing classifier attempts to 2 in ClassifierStrategy and NumericalClassifierStrategy so unreachable networks fail fast to DefaultStrategy instead of burning 5 full retry cycles before starting a second chat retry loop. - Fail fast in isRetryableError on deterministic network/TLS error codes (e.g. ENETUNREACH, EHOSTUNREACH, EACCES, UNABLE_TO_VERIFY_LEAF_SIGNATURE, SELF_SIGNED_CERT_IN_CHAIN, ERR_TLS_CERT_ALTNAME_INVALID) wrapped in TypeError: fetch failed even when retryFetchErrors is true. - Support ALL_PROXY and all_proxy environment variable fallbacks in CLI proxy configuration. - Surface network connectivity retry progress immediately in useLoadingIndicator even when ui.errorVerbosity is low. Fixes google-gemini#29698
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 addresses silent, long-running hangs in the Gemini CLI caused by network connectivity issues. By implementing better abort signal propagation, introducing fail-fast mechanisms for non-recoverable network errors, and improving user feedback during retries, the CLI now provides a more responsive and transparent experience when encountering network failures. 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 the 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 counterproductive. 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
|
|
📊 PR Size: size/M
|
There was a problem hiding this comment.
Code Review
This pull request introduces several improvements to proxy configuration, network retry behavior, and LLM client robustness. Specifically, it adds support for the ALL_PROXY and all_proxy environment variables, ensures deterministic network/TLS errors fail fast instead of retrying, and passes abort signals to the retry mechanisms. Additionally, it immediately surfaces retry progress for network failures in low error verbosity mode. Feedback on the changes identifies a bug in the network retry regex within useLoadingIndicator.ts, where normalized FETCH_FAILED errors will not be matched due to a missing underscore in the pattern.
|
/Gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces several improvements to proxy support, retry mechanisms, and error handling. Specifically, it adds support for the ALL_PROXY and all_proxy environment variables in the CLI configuration and refactors the proxy tests to use vi.stubEnv in accordance with the repository's testing conventions. Additionally, it refines the retry logic by passing abort signals to LLM client retries, limiting classifier strategy attempts to 2, and introducing a list of non-retryable network/TLS error codes (such as ENETUNREACH and certificate errors) to fail fast on deterministic failures. Finally, it updates the loading indicator to immediately surface retry progress for network failures even in low error verbosity mode. I have no further feedback to provide as there are no review comments.
Summary
Details
Related Issues
Fixes #29698
How to Validate
Pre-Merge Checklist