diff --git a/packages/cli/src/ui/components/DialogManager.tsx b/packages/cli/src/ui/components/DialogManager.tsx index 325009db67..132b1a020e 100644 --- a/packages/cli/src/ui/components/DialogManager.tsx +++ b/packages/cli/src/ui/components/DialogManager.tsx @@ -62,7 +62,6 @@ export const DialogManager = ({ isTerminalQuotaError={uiState.proQuotaRequest.isTerminalQuotaError} isModelNotFoundError={!!uiState.proQuotaRequest.isModelNotFoundError} onChoice={uiActions.handleProQuotaChoice} - userTier={uiState.userTier} /> ); } diff --git a/packages/cli/src/ui/components/ProQuotaDialog.test.tsx b/packages/cli/src/ui/components/ProQuotaDialog.test.tsx index 2520036246..f74f5fa447 100644 --- a/packages/cli/src/ui/components/ProQuotaDialog.test.tsx +++ b/packages/cli/src/ui/components/ProQuotaDialog.test.tsx @@ -12,7 +12,6 @@ import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; import { PREVIEW_GEMINI_MODEL, - UserTierId, DEFAULT_GEMINI_FLASH_MODEL, } from '@google/gemini-cli-core'; @@ -37,7 +36,6 @@ describe('ProQuotaDialog', () => { message="flash error" isTerminalQuotaError={true} // should not matter onChoice={mockOnChoice} - userTier={UserTierId.FREE} />, ); @@ -64,7 +62,7 @@ describe('ProQuotaDialog', () => { describe('for non-flash model failures', () => { describe('when it is a terminal quota error', () => { - it('should render switch and stop options for paid tiers', () => { + it('should render switch, upgrade, and stop options for paid tiers', () => { const { unmount } = render( { isTerminalQuotaError={true} isModelNotFoundError={false} onChoice={mockOnChoice} - userTier={UserTierId.LEGACY} />, ); @@ -85,6 +82,11 @@ describe('ProQuotaDialog', () => { value: 'retry_always', key: 'retry_always', }, + { + label: 'Upgrade for higher limits', + value: 'upgrade', + key: 'upgrade', + }, { label: 'Stop', value: 'retry_later', @@ -105,7 +107,6 @@ describe('ProQuotaDialog', () => { message="flash error" isTerminalQuotaError={true} onChoice={mockOnChoice} - userTier={UserTierId.FREE} />, ); @@ -138,7 +139,6 @@ describe('ProQuotaDialog', () => { isTerminalQuotaError={true} isModelNotFoundError={false} onChoice={mockOnChoice} - userTier={UserTierId.FREE} />, ); @@ -178,7 +178,6 @@ describe('ProQuotaDialog', () => { isTerminalQuotaError={false} isModelNotFoundError={false} onChoice={mockOnChoice} - userTier={UserTierId.FREE} />, ); @@ -214,7 +213,6 @@ describe('ProQuotaDialog', () => { isTerminalQuotaError={false} isModelNotFoundError={true} onChoice={mockOnChoice} - userTier={UserTierId.FREE} />, ); @@ -226,6 +224,11 @@ describe('ProQuotaDialog', () => { value: 'retry_always', key: 'retry_always', }, + { + label: 'Upgrade for higher limits', + value: 'upgrade', + key: 'upgrade', + }, { label: 'Stop', value: 'retry_later', @@ -247,7 +250,6 @@ describe('ProQuotaDialog', () => { isTerminalQuotaError={false} isModelNotFoundError={true} onChoice={mockOnChoice} - userTier={UserTierId.LEGACY} />, ); @@ -259,6 +261,11 @@ describe('ProQuotaDialog', () => { value: 'retry_always', key: 'retry_always', }, + { + label: 'Upgrade for higher limits', + value: 'upgrade', + key: 'upgrade', + }, { label: 'Stop', value: 'retry_later', @@ -282,7 +289,6 @@ describe('ProQuotaDialog', () => { message="" isTerminalQuotaError={false} onChoice={mockOnChoice} - userTier={UserTierId.FREE} />, ); diff --git a/packages/cli/src/ui/components/ProQuotaDialog.tsx b/packages/cli/src/ui/components/ProQuotaDialog.tsx index 0dbf134c5b..ccc20b3e75 100644 --- a/packages/cli/src/ui/components/ProQuotaDialog.tsx +++ b/packages/cli/src/ui/components/ProQuotaDialog.tsx @@ -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}`,