这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@JayadityaGit
Copy link
Contributor

@JayadityaGit JayadityaGit commented Aug 26, 2025

after TLDR

This PR introduces the ProQuotaDialog to improve how the CLI handles situations where a user exceeds their daily Pro model usage quota.

Instead of abruptly stopping with a basic notification, the CLI now presents an interactive dialog with clear options:

  1. Authenticate → run /auth directly from the dialog to switch to another auth method (e.g., a paid method with higher limits).
  2. Continue with Fallback (Flash) → keep using Flash with a helpful tip (Ctrl+P) to recall recent prompts, so users don’t need to retype.

Additionally, this PR also removes the i prefix from the InfoMessage component for consistency.


Dive Deeper

Why is this needed?

  • Previously, when users hit their Pro quota, the process was interrupted with a plain notification.
  • Users had to manually re-run /auth if they wanted to switch to another auth method.
  • If they continued with Flash, they had to re-enter their last prompt from scratch.
  • This caused unnecessary friction and slowed down workflows.

What’s changed?

  • Added ProQuotaDialog that replaces the abrupt notification-only behavior.
  • Provides inline /auth action for switching auth methods.
  • Provides fallback option with a productivity tip (Ctrl+P) for reusing prompts.
  • Removed the i prefix from the InfoMessage component for consistency and clarity.

Benefits

  • Transparency → Users are informed immediately when quota is reached.
  • Control → Users decide whether to authenticate or continue with Flash.
  • Efficiency → Users can reuse prompts when switching to Flash.

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

@JayadityaGit JayadityaGit requested a review from a team as a code owner August 26, 2025 09:33
Copy link
Contributor

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

Choose a reason for hiding this comment

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

Summary of Changes

Hello @JayadityaGit, 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 introduces a new interactive ProQuotaDialog in the CLI to enhance the user experience when daily Pro model usage quotas are exceeded. Instead of a simple notification, users are now presented with clear options: either authenticate with a different method or continue using the fallback Flash model. This change aims to reduce friction and improve workflow continuity. Additionally, a minor UI consistency update removes the 'i' prefix from the InfoMessage component.

Highlights

  • Pro Quota Handling: Implements a new ProQuotaDialog to provide an interactive experience when users hit their daily Pro model usage quota, replacing the previous abrupt notification.
  • User Choice & Control: The dialog offers users two distinct choices: to re-authenticate using a different method (e.g., a paid API key) or to continue with the fallback Flash model.
  • Fallback Experience Improvement: When opting to continue with the Flash model, the CLI now provides a helpful tip (Ctrl+P) to recall previous prompts, preventing users from having to retype them.
  • UI Consistency: Removes the 'i' prefix from the InfoMessage component for improved visual consistency across the CLI's user interface.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 .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 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

  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.

Copy link
Contributor

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

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 ProQuotaDialog to provide a better user experience when the Pro model quota is exceeded, allowing users to either authenticate or switch to a fallback model. The changes are generally good, but there are a few areas with duplicated logic and a potential regression that should be addressed. I've identified two instances of code duplication in App.tsx that can be refactored for better maintainability. More critically, a change to the isInputActive condition appears to disable the message queuing feature, which would prevent users from typing ahead while a response is streaming. I've provided suggestions to fix these issues.

@JayadityaGit
Copy link
Contributor Author

Hi team 👋,

This PR introduces the new ProQuotaDialog (and also removes the i prefix from the InfoMessage component). It replaces the old abrupt notification-only flow with a dialog that gives users two clear options when their Pro quota is exceeded:

Switch to another auth method directly from the dialog.

Continue with Flash, with a tip to use Ctrl+P for recalling prompts.

I would really appreciate it if someone could give this a review 🙏. Thank you in advance for your time and feedback!

Copy link
Collaborator

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

Thanks for adding this flow. If done right I think this will significantly reduce the friction for users that are out of pro quota.

@jacob314
Copy link
Collaborator

Fyi @bdmorgan let me know if you have any concerns about adding this dialog.

@bdmorgan
Copy link
Collaborator

@jacob314 LGTM! Definitely an improvement

@JayadityaGit JayadityaGit marked this pull request as draft August 27, 2025 03:02
@JayadityaGit
Copy link
Contributor Author

Thank you for the review! I’ll come back with refinements as soon as possible.

@JayadityaGit JayadityaGit force-pushed the feat/pro-quota-dialog branch from b8c587e to 49bf777 Compare August 27, 2025 06:16
@JayadityaGit JayadityaGit force-pushed the feat/pro-quota-dialog branch from 49bf777 to ebcea0e Compare August 27, 2025 06:27
@JayadityaGit
Copy link
Contributor Author

refine

I’ve addressed the requested changes, resolved the merge conflicts, and removed unnecessary modifications. Looking forward to your review, and I’m happy to make any further refinements if needed.

@JayadityaGit JayadityaGit marked this pull request as ready for review August 27, 2025 06:30
@JayadityaGit JayadityaGit requested a review from jacob314 August 27, 2025 06:30
Copy link
Collaborator

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you for this significant UX improvement! I'll approve as soon as tests are added so that we don't regress this logic. Tests for this are particularly important as people will rarely test it manually due to having to run out of quota to test it.

@JayadityaGit JayadityaGit marked this pull request as draft August 28, 2025 03:44
@JayadityaGit JayadityaGit force-pushed the feat/pro-quota-dialog branch 2 times, most recently from 82ff3e3 to 7c7cb5a Compare August 28, 2025 06:43
JayadityaGit and others added 2 commits August 28, 2025 12:48
Adds tests for the `ProQuotaDialog` component.
The tests cover the following scenarios:
- The dialog renders with the correct title and options.
- The `onChoice` callback is called with the correct value when the user selects an option.
@JayadityaGit
Copy link
Contributor Author

I’ve added unit tests for ProQuotaDialog:

Verifies the dialog renders with the correct title and options.

Mocks RadioButtonSelect so the parent logic is tested in isolation.

Ensures onChoice is triggered correctly for both Change auth (auth) and Continue with flash (continue).

All preflight checks are passing ✅, so this should prevent regressions in future.

@JayadityaGit JayadityaGit marked this pull request as ready for review August 28, 2025 07:28
@JayadityaGit JayadityaGit requested a review from jacob314 August 28, 2025 07:28
@jacob314 jacob314 enabled auto-merge August 28, 2025 21:29
Copy link
Collaborator

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

@jacob314 jacob314 added this pull request to the merge queue Aug 28, 2025
Merged via the queue into google-gemini:main with commit a63e678 Aug 28, 2025
18 checks passed
thacio added a commit to thacio/auditaria that referenced this pull request Aug 28, 2025
davideast pushed a commit to davideast/gemini-cli that referenced this pull request Sep 2, 2025
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
acoliver referenced this pull request in vybestack/llxprt-code Sep 19, 2025
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
(cherry picked from commit a63e678)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improving Pro Model Quota Handling in the CLI

3 participants