Skip to content

fix(cli): display retry progress indicator during connection recovery (#28340) - #29468

Merged
DavidAPierce merged 3 commits into
google-gemini:mainfrom
amelidev:b_561554757
Sep 23, 2026
Merged

DavidAPierce merged 3 commits into
google-gemini:mainfrom
amelidev:b_561554757

Conversation

@amelidev

Copy link
Copy Markdown
Contributor

Summary

Fixes an issue where the terminal loading indicator fails to display retry progress when connection failures, rate limits (429), or server overloads (503) occur with ui.errorVerbosity = "full". The UI previously stayed perpetually stuck displaying "Thinking..." because the retry status phrase was dropped during status bar refactoring and suppressed by active thought subjects.

Details

  • Decoupled Status Telemetry from Cosmetic Phrases: In useLoadingIndicator.ts, separated actionable connection retry telemetry into a dedicated statusPhrase property distinct from cosmetic currentLoadingPhrase (tips and witty phrases).
  • Plumbed State through UI Architecture: Added statusPhrase to UIStateContext, surfaced it in AppContainer.tsx, and passed it down through StatusRowProps, StatusRow, and StatusNode to <LoadingIndicator>.
  • Aligned Display Priority: In LoadingIndicator.tsx, prioritized statusPhrase above thought?.subject. This ensures critical operational recovery status (e.g., Trying to reach gemini-2.5-flash (Attempt 2/5)) is always immediately visible to the user, while keeping cosmetic rotating tips and witty phrases properly subordinate to model thoughts.
  • Comprehensive Unit Testing:
    • StatusRow.test.tsx: Verified rendering of statusPhrase from uiState, prioritization over thoughts, direct prop passing, generic low-verbosity retry hints, active hooks, and narrow terminal handling.
    • LoadingIndicator.test.tsx: Verified statusPhrase priority over both thought.subject and currentLoadingPhrase.
    • useLoadingIndicator.test.tsx: Verified statusPhrase generation when responding with retries and cleanup when idle.

Related Issues

Fixes #28340
Resolves b/561554757

How to Validate

  1. Run targeted unit tests for the modified modules:
    npm test -w @google/gemini-cli -- src/ui/hooks/useLoadingIndicator.test.tsx src/ui/components/StatusRow.test.tsx src/ui/components/LoadingIndicator.test.tsx
  2. Verify full package compilation, linting, and typecheck:
    npm run build
    npm run typecheck -w @google/gemini-cli
    npm run lint -w @google/gemini-cli
  3. Manual verification across scenarios:
    • Full verbosity with retry: Start query while intercepting/returning 503; verify spinner displays Trying to reach <model> (Attempt N/M).
    • Thought present with retry: Trigger retry during thinking; verify retry indicator overrides "Thinking...".
    • Low verbosity: Set ui.errorVerbosity: "low"; verify retry message is hidden until attempt threshold is met, then displays "This is taking a bit longer, we're still on it.".
    • Normal stream without retry: Verify model thoughts and cosmetic tips continue to render properly.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

…google-gemini#28340)

- Decouple actionable statusPhrase from cosmetic loading phrases in useLoadingIndicator
- Expose statusPhrase in UIState and forward through StatusRow/StatusNode to LoadingIndicator
- Prioritize statusPhrase over thought.subject in LoadingIndicator so connection retries are always visible
- Add comprehensive unit tests in StatusRow, LoadingIndicator, and useLoadingIndicator
@amelidev
amelidev requested a review from a team as a code owner September 23, 2026 20:12
@github-actions github-actions Bot added the size/l A large sized PR label Sep 23, 2026
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

📊 PR Size: size/L

  • Lines changed: 356
  • Additions: +339
  • Deletions: -17
  • Files changed: 8

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 an issue where critical connection retry information was being suppressed by cosmetic UI elements in the Gemini CLI. By decoupling operational status telemetry from general loading phrases and updating the UI rendering logic to prioritize this status, the CLI now reliably displays retry progress during connection failures, rate limits, or server overloads.

Highlights

  • Decoupled Status Telemetry: Separated connection retry status from cosmetic loading phrases in useLoadingIndicator.ts to ensure operational feedback is distinct.
  • UI Architecture Updates: Plumbed the new statusPhrase through UIStateContext, AppContainer, and StatusRow components to ensure consistent propagation.
  • Display Priority Logic: Updated LoadingIndicator.tsx to prioritize statusPhrase over model thoughts and cosmetic tips, ensuring retry information is always visible.
  • Comprehensive Testing: Added unit tests for StatusRow, LoadingIndicator, and useLoadingIndicator to verify priority, rendering, and cleanup behavior.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@amelidev

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new statusPhrase property to the UI state and components (LoadingIndicator, StatusRow, and AppContainer) to display active operational statuses, such as connection retries. It prioritizes statusPhrase over other loading text (like thoughts or tips) and includes comprehensive unit tests to validate this behavior across different scenarios. I have no feedback to provide as there are no review comments to address.

@gemini-cli gemini-cli Bot added priority/p1 Important and should be addressed in the near term. area/core Issues related to User Interface, OS Support, Core Functionality labels Sep 23, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new "statusPhrase" field to the UI state and loading indicator components to display active operational status (such as connection retries) with higher priority than thoughts or other loading phrases. Corresponding unit tests have been added to verify this behavior. A review comment points out a potential issue where the "statusPhrase" might be hidden from the user if "showLoadingIndicator" is false, and suggests updating the rendering conditions in "StatusRow" and "StatusNode" to prevent this.

Comment thread packages/cli/src/ui/components/StatusRow.tsx
@amelidev

Copy link
Copy Markdown
Contributor Author

Addressed: Updated StatusNode early-bailout check and showRow1Minimal in StatusRow.tsx to account for statusPhrase. Added a unit test verifying statusPhrase displays even when showLoadingIndicator is false.

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new statusPhrase property to the CLI's UI state and components, including LoadingIndicator, StatusRow, AppContainer, and the useLoadingIndicator hook. This property is used to track and display active operational statuses (such as connection retries) and is prioritized over thought subjects or cosmetic loading phrases. Comprehensive unit tests have been added to verify the correct prioritization and rendering behavior under various conditions. I have no feedback to provide.

@DavidAPierce
DavidAPierce added this pull request to the merge queue Sep 23, 2026
Merged via the queue into google-gemini:main with commit 8e70c86 Sep 23, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality priority/p1 Important and should be addressed in the near term. size/l A large sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui.errorVerbosity = "full", does not display retry progress indicators in the UI

2 participants