-
Notifications
You must be signed in to change notification settings - Fork 9.3k
feat: add Pro Quota Dialog #7094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Pro Quota Dialog #7094
Conversation
There was a problem hiding this 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
-
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. ↩
There was a problem hiding this 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.
|
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! |
jacob314
left a comment
There was a problem hiding this 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.
|
Fyi @bdmorgan let me know if you have any concerns about adding this dialog. |
|
@jacob314 LGTM! Definitely an improvement |
|
Thank you for the review! I’ll come back with refinements as soon as possible. |
b8c587e to
49bf777
Compare
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
49bf777 to
ebcea0e
Compare
jacob314
left a comment
There was a problem hiding this 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.
82ff3e3 to
7c7cb5a
Compare
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.
|
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. |
jacob314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Jacob Richman <jacob314@gmail.com>
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)
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:
/authdirectly from the dialog to switch to another auth method (e.g., a paid method with higher limits).Ctrl+P) to recall recent prompts, so users don’t need to retype.Additionally, this PR also removes the
iprefix from the InfoMessage component for consistency.Dive Deeper
Why is this needed?
/authif they wanted to switch to another auth method.What’s changed?
/authaction for switching auth methods.Ctrl+P) for reusing prompts.iprefix from the InfoMessage component for consistency and clarity.Benefits
Testing Matrix
Linked issues / bugs