Add upgrade option for paid users (#15978)

This commit is contained in:
cayden-google
2026-01-08 13:01:40 +11:00
committed by GitHub
parent d48c934357
commit aca6bf6aa0
3 changed files with 18 additions and 34 deletions

View File

@@ -9,8 +9,6 @@ import { Box, Text } from 'ink';
import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
import { theme } from '../semantic-colors.js';
import { UserTierId } from '@google/gemini-cli-core';
interface ProQuotaDialogProps {
failedModel: string;
fallbackModel: string;
@@ -20,7 +18,6 @@ interface ProQuotaDialogProps {
onChoice: (
choice: 'retry_later' | 'retry_once' | 'retry_always' | 'upgrade',
) => void;
userTier: UserTierId | undefined;
}
export function ProQuotaDialog({
@@ -30,11 +27,7 @@ export function ProQuotaDialog({
isTerminalQuotaError,
isModelNotFoundError,
onChoice,
userTier,
}: ProQuotaDialogProps): React.JSX.Element {
// Use actual user tier if available; otherwise, default to FREE tier behavior (safe default)
const isPaidTier =
userTier === UserTierId.LEGACY || userTier === UserTierId.STANDARD;
let items;
// Do not provide a fallback option if failed model and fallbackmodel are same.
if (failedModel === fallbackModel) {
@@ -50,22 +43,8 @@ export function ProQuotaDialog({
key: 'retry_later',
},
];
} else if (isModelNotFoundError || (isTerminalQuotaError && isPaidTier)) {
// out of quota
items = [
{
label: `Switch to ${fallbackModel}`,
value: 'retry_always' as const,
key: 'retry_always',
},
{
label: `Stop`,
value: 'retry_later' as const,
key: 'retry_later',
},
];
} else if (isTerminalQuotaError && !isPaidTier) {
// free user gets an option to upgrade
} else if (isModelNotFoundError || isTerminalQuotaError) {
// free users and out of quota users on G1 pro and Cloud Console gets an option to upgrade
items = [
{
label: `Switch to ${fallbackModel}`,