Skip to content

Commit 7e0ac00

Browse files
sehoon38scidomino
authored andcommitted
feat(cli): show Flash Lite Preview model regardless of user tier (#23904)
1 parent bbd8483 commit 7e0ac00

2 files changed

Lines changed: 2 additions & 36 deletions

File tree

packages/cli/src/ui/components/ModelDialog.test.tsx

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
PREVIEW_GEMINI_FLASH_MODEL,
2222
PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
2323
AuthType,
24-
UserTierId,
2524
} from '@google/gemini-cli-core';
2625
import type { Config, ModelSlashCommandEvent } from '@google/gemini-cli-core';
2726

@@ -56,7 +55,6 @@ describe('<ModelDialog />', () => {
5655
const mockGetGemini31FlashLiteLaunchedSync = vi.fn();
5756
const mockGetProModelNoAccess = vi.fn();
5857
const mockGetProModelNoAccessSync = vi.fn();
59-
const mockGetUserTier = vi.fn();
6058

6159
interface MockConfig extends Partial<Config> {
6260
setModel: (model: string, isTemporary?: boolean) => void;
@@ -67,7 +65,6 @@ describe('<ModelDialog />', () => {
6765
getGemini31FlashLiteLaunchedSync: () => boolean;
6866
getProModelNoAccess: () => Promise<boolean>;
6967
getProModelNoAccessSync: () => boolean;
70-
getUserTier: () => UserTierId | undefined;
7168
}
7269

7370
const mockConfig: MockConfig = {
@@ -79,7 +76,6 @@ describe('<ModelDialog />', () => {
7976
getGemini31FlashLiteLaunchedSync: mockGetGemini31FlashLiteLaunchedSync,
8077
getProModelNoAccess: mockGetProModelNoAccess,
8178
getProModelNoAccessSync: mockGetProModelNoAccessSync,
82-
getUserTier: mockGetUserTier,
8379
};
8480

8581
beforeEach(() => {
@@ -90,7 +86,6 @@ describe('<ModelDialog />', () => {
9086
mockGetGemini31FlashLiteLaunchedSync.mockReturnValue(false);
9187
mockGetProModelNoAccess.mockResolvedValue(false);
9288
mockGetProModelNoAccessSync.mockReturnValue(false);
93-
mockGetUserTier.mockReturnValue(UserTierId.STANDARD);
9489

9590
// Default implementation for getDisplayString
9691
mockGetDisplayString.mockImplementation((val: string) => {
@@ -136,7 +131,6 @@ describe('<ModelDialog />', () => {
136131
mockGetProModelNoAccess.mockResolvedValue(true);
137132
mockGetHasAccessToPreviewModel.mockReturnValue(true);
138133
mockGetGemini31FlashLiteLaunchedSync.mockReturnValue(true);
139-
mockGetUserTier.mockReturnValue(UserTierId.FREE);
140134
mockGetDisplayString.mockImplementation((val: string) => val);
141135

142136
const { lastFrame, unmount } = await renderComponent();
@@ -442,34 +436,11 @@ describe('<ModelDialog />', () => {
442436
unmount();
443437
});
444438

445-
it('hides Flash Lite Preview model for users with pro access', async () => {
446-
mockGetProModelNoAccessSync.mockReturnValue(false);
447-
mockGetProModelNoAccess.mockResolvedValue(false);
448-
mockGetHasAccessToPreviewModel.mockReturnValue(true);
449-
const { lastFrame, stdin, waitUntilReady, unmount } =
450-
await renderComponent();
451-
452-
// Go to manual view
453-
await act(async () => {
454-
stdin.write('\u001B[B'); // Manual
455-
});
456-
await waitUntilReady();
457-
await act(async () => {
458-
stdin.write('\r');
459-
});
460-
await waitUntilReady();
461-
462-
const output = lastFrame();
463-
expect(output).not.toContain(PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL);
464-
unmount();
465-
});
466-
467-
it('shows Flash Lite Preview model for free tier users', async () => {
439+
it('shows Flash Lite Preview model regardless of tier when flag is enabled', async () => {
468440
mockGetProModelNoAccessSync.mockReturnValue(false);
469441
mockGetProModelNoAccess.mockResolvedValue(false);
470442
mockGetHasAccessToPreviewModel.mockReturnValue(true);
471443
mockGetGemini31FlashLiteLaunchedSync.mockReturnValue(true);
472-
mockGetUserTier.mockReturnValue(UserTierId.FREE);
473444
const { lastFrame, stdin, waitUntilReady, unmount } =
474445
await renderComponent();
475446

packages/cli/src/ui/components/ModelDialog.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
AuthType,
2424
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
2525
isProModel,
26-
UserTierId,
2726
} from '@google/gemini-cli-core';
2827
import { useKeypress } from '../hooks/useKeypress.js';
2928
import { theme } from '../semantic-colors.js';
@@ -190,7 +189,6 @@ export function ModelDialog({ onClose }: ModelDialogProps): React.JSX.Element {
190189
}, [config, shouldShowPreviewModels, manualModelSelected, useGemini31]);
191190

192191
const manualOptions = useMemo(() => {
193-
const isFreeTier = config?.getUserTier() === UserTierId.FREE;
194192
// --- DYNAMIC PATH ---
195193
if (
196194
config?.getExperimentalDynamicModelConfiguration?.() === true &&
@@ -207,9 +205,6 @@ export function ModelDialog({ onClose }: ModelDialogProps): React.JSX.Element {
207205
if (m.tier === 'auto') return false;
208206
// Pro models are shown for users with pro access
209207
if (!hasAccessToProModel && m.tier === 'pro') return false;
210-
// 3.1 Preview Flash-lite is only available on free tier
211-
if (m.tier === 'flash-lite' && m.isPreview && !isFreeTier)
212-
return false;
213208

214209
// Flag Guard: Versioned models only show if their flag is active.
215210
if (id === PREVIEW_GEMINI_3_1_MODEL && !useGemini31) return false;
@@ -292,7 +287,7 @@ export function ModelDialog({ onClose }: ModelDialogProps): React.JSX.Element {
292287
},
293288
];
294289

295-
if (isFreeTier && useGemini31FlashLite) {
290+
if (useGemini31FlashLite) {
296291
previewOptions.push({
297292
value: PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
298293
title: getDisplayString(PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL),

0 commit comments

Comments
 (0)