Repository navigation
[SSR Agent] Issue Fix (24587): Fix misleading admin error for personal accounts - #28819
Conversation
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 a UX issue where personal account users were receiving confusing, enterprise-specific error messages when attempting to access restricted Gemini models. By checking the user's tier during model access failures, the CLI now provides accurate feedback based on the user's account type, improving clarity and reducing support friction. 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
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates the useQuotaAndFallback hook and its tests to display a distinct error message when a ModelNotFoundError occurs for personal (free) accounts versus enterprise/workspace accounts. Feedback on the changes suggests refactoring the message construction logic to extract the common prefix and avoid duplicating the array creation and joining code, which improves readability and maintainability.
…l accounts $fixes google-gemini#24587 ### Related Issue Original Issue URL: google-gemini#24587 ### Context & Problem When an authenticated user on a personal account selects a Gemini model that is not available for personal accounts, the CLI displays a misleading enterprise-specific error message referencing admin settings and Preview Release Channels. This is because the `ModelNotFoundError` handler in `useQuotaAndFallback.ts` hardcoded this enterprise-specific error message for valid Gemini models without validating whether the user is on a personal or managed account tier. ### Detailed Changes - **packages/cli/src/ui/hooks/useQuotaAndFallback.ts**: Updated the `ModelNotFoundError` handling logic for `VALID_GEMINI_MODELS` to conditionally inspect the `userTier`. If the tier is `UserTierId.FREE` (representing a personal user), the CLI now raises a clean, context-specific error indicating the model is unavailable for personal accounts without mentioning administrative permissions or Preview Release Channels. In other tiers, the original administrator warning is preserved. - **packages/cli/src/ui/hooks/useQuotaAndFallback.test.ts**: Split the `ModelNotFoundError` unit test into two comprehensive tests: one verifying personal accounts (`UserTierId.FREE`) and ensuring they receive the simplified personal-account message (asserting no mention of 'admin' or 'Preview Release Channel'), and one verifying enterprise/workspace accounts (`UserTierId.STANDARD`) retaining the administrative instructions. ### Verification - Executed unit tests in `useQuotaAndFallback.test.ts` via Vitest to assert correct behavior and expected text outputs for both personal and enterprise user tiers. - Verified ESLint checks ran successfully without any warnings or errors.
91b23b2 to
98faf50
Compare
fixes #24587
Related Issue
Original Issue URL: #24587
Context & Problem
When an authenticated user on a personal account selects a Gemini model that is not available for personal accounts, the CLI displays a misleading enterprise-specific error message referencing admin settings and Preview Release Channels. This is because the
ModelNotFoundErrorhandler inuseQuotaAndFallback.tshardcoded this enterprise-specific error message for valid Gemini models without validating whether the user is on a personal or managed account tier.Detailed Changes
ModelNotFoundErrorhandling logic forVALID_GEMINI_MODELSto conditionally inspect theuserTier. If the tier isUserTierId.FREE(representing a personal user), the CLI now raises a clean, context-specific error indicating the model is unavailable for personal accounts without mentioning administrative permissions or Preview Release Channels. In other tiers, the original administrator warning is preserved.ModelNotFoundErrorunit test into two comprehensive tests: one verifying personal accounts (UserTierId.FREE) and ensuring they receive the simplified personal-account message (asserting no mention of 'admin' or 'Preview Release Channel'), and one verifying enterprise/workspace accounts (UserTierId.STANDARD) retaining the administrative instructions.Verification
useQuotaAndFallback.test.tsvia Vitest to assert correct behavior and expected text outputs for both personal and enterprise user tiers.