diff --git a/packages/cli/src/ui/components/ModelDialog.test.tsx b/packages/cli/src/ui/components/ModelDialog.test.tsx index fd5df5db89..e40f39befc 100644 --- a/packages/cli/src/ui/components/ModelDialog.test.tsx +++ b/packages/cli/src/ui/components/ModelDialog.test.tsx @@ -21,7 +21,6 @@ import { PREVIEW_GEMINI_FLASH_MODEL, PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL, AuthType, - UserTierId, } from '@google/gemini-cli-core'; import type { Config, ModelSlashCommandEvent } from '@google/gemini-cli-core'; @@ -56,7 +55,6 @@ describe('', () => { const mockGetGemini31FlashLiteLaunchedSync = vi.fn(); const mockGetProModelNoAccess = vi.fn(); const mockGetProModelNoAccessSync = vi.fn(); - const mockGetUserTier = vi.fn(); interface MockConfig extends Partial { setModel: (model: string, isTemporary?: boolean) => void; @@ -67,7 +65,6 @@ describe('', () => { getGemini31FlashLiteLaunchedSync: () => boolean; getProModelNoAccess: () => Promise; getProModelNoAccessSync: () => boolean; - getUserTier: () => UserTierId | undefined; } const mockConfig: MockConfig = { @@ -79,7 +76,6 @@ describe('', () => { getGemini31FlashLiteLaunchedSync: mockGetGemini31FlashLiteLaunchedSync, getProModelNoAccess: mockGetProModelNoAccess, getProModelNoAccessSync: mockGetProModelNoAccessSync, - getUserTier: mockGetUserTier, }; beforeEach(() => { @@ -90,7 +86,6 @@ describe('', () => { mockGetGemini31FlashLiteLaunchedSync.mockReturnValue(false); mockGetProModelNoAccess.mockResolvedValue(false); mockGetProModelNoAccessSync.mockReturnValue(false); - mockGetUserTier.mockReturnValue(UserTierId.STANDARD); // Default implementation for getDisplayString mockGetDisplayString.mockImplementation((val: string) => { @@ -136,7 +131,6 @@ describe('', () => { mockGetProModelNoAccess.mockResolvedValue(true); mockGetHasAccessToPreviewModel.mockReturnValue(true); mockGetGemini31FlashLiteLaunchedSync.mockReturnValue(true); - mockGetUserTier.mockReturnValue(UserTierId.FREE); mockGetDisplayString.mockImplementation((val: string) => val); const { lastFrame, unmount } = await renderComponent(); @@ -442,34 +436,11 @@ describe('', () => { unmount(); }); - it('hides Flash Lite Preview model for users with pro access', async () => { - mockGetProModelNoAccessSync.mockReturnValue(false); - mockGetProModelNoAccess.mockResolvedValue(false); - mockGetHasAccessToPreviewModel.mockReturnValue(true); - const { lastFrame, stdin, waitUntilReady, unmount } = - await renderComponent(); - - // Go to manual view - await act(async () => { - stdin.write('\u001B[B'); // Manual - }); - await waitUntilReady(); - await act(async () => { - stdin.write('\r'); - }); - await waitUntilReady(); - - const output = lastFrame(); - expect(output).not.toContain(PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL); - unmount(); - }); - - it('shows Flash Lite Preview model for free tier users', async () => { + it('shows Flash Lite Preview model regardless of tier when flag is enabled', async () => { mockGetProModelNoAccessSync.mockReturnValue(false); mockGetProModelNoAccess.mockResolvedValue(false); mockGetHasAccessToPreviewModel.mockReturnValue(true); mockGetGemini31FlashLiteLaunchedSync.mockReturnValue(true); - mockGetUserTier.mockReturnValue(UserTierId.FREE); const { lastFrame, stdin, waitUntilReady, unmount } = await renderComponent(); diff --git a/packages/cli/src/ui/components/ModelDialog.tsx b/packages/cli/src/ui/components/ModelDialog.tsx index 0bd7918248..618bc353c1 100644 --- a/packages/cli/src/ui/components/ModelDialog.tsx +++ b/packages/cli/src/ui/components/ModelDialog.tsx @@ -23,7 +23,6 @@ import { AuthType, PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, isProModel, - UserTierId, } from '@google/gemini-cli-core'; import { useKeypress } from '../hooks/useKeypress.js'; import { theme } from '../semantic-colors.js'; @@ -190,7 +189,6 @@ export function ModelDialog({ onClose }: ModelDialogProps): React.JSX.Element { }, [config, shouldShowPreviewModels, manualModelSelected, useGemini31]); const manualOptions = useMemo(() => { - const isFreeTier = config?.getUserTier() === UserTierId.FREE; // --- DYNAMIC PATH --- if ( config?.getExperimentalDynamicModelConfiguration?.() === true && @@ -207,9 +205,6 @@ export function ModelDialog({ onClose }: ModelDialogProps): React.JSX.Element { if (m.tier === 'auto') return false; // Pro models are shown for users with pro access if (!hasAccessToProModel && m.tier === 'pro') return false; - // 3.1 Preview Flash-lite is only available on free tier - if (m.tier === 'flash-lite' && m.isPreview && !isFreeTier) - return false; // Flag Guard: Versioned models only show if their flag is active. if (id === PREVIEW_GEMINI_3_1_MODEL && !useGemini31) return false; @@ -292,7 +287,7 @@ export function ModelDialog({ onClose }: ModelDialogProps): React.JSX.Element { }, ]; - if (isFreeTier && useGemini31FlashLite) { + if (useGemini31FlashLite) { previewOptions.push({ value: PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL, title: getDisplayString(PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL),