Skip to content

Commit 929a591

Browse files
committed
update: add Pro 3.1
1 parent 3955f40 commit 929a591

8 files changed

Lines changed: 16 additions & 12 deletions

File tree

packages/cli/src/config/settingsSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ const SETTINGS_SCHEMA = {
835835
requiresRestart: false,
836836
default: {},
837837
description: 'Billing and AI credits settings.',
838-
showInDialog: true,
838+
showInDialog: false,
839839
properties: {
840840
overageStrategy: {
841841
type: 'enum',

packages/cli/src/ui/commands/statsCommand.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('statsCommand', () => {
6262
tier: undefined,
6363
userEmail: 'mock@example.com',
6464
currentModel: undefined,
65-
creditBalance: null,
65+
creditBalance: undefined,
6666
});
6767
});
6868

packages/cli/src/ui/commands/statsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function getUserIdentity(context: CommandContext) {
3131

3232
const tier = context.services.config?.getUserTierName();
3333
const paidTier = context.services.config?.getUserPaidTier();
34-
const creditBalance = getG1CreditBalance(paidTier);
34+
const creditBalance = getG1CreditBalance(paidTier) ?? undefined;
3535

3636
return { selectedAuthType, userEmail, tier, creditBalance };
3737
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,7 @@ interface StatsDisplayProps {
395395
tier?: string;
396396
currentModel?: string;
397397
quotaStats?: QuotaStats;
398-
/** G1 AI Credits balance, null if not eligible */
399-
creditBalance?: number | null;
398+
creditBalance?: number;
400399
}
401400

402401
export const StatsDisplay: React.FC<StatsDisplayProps> = ({

packages/cli/src/ui/hooks/creditsFlowHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ export async function handleCreditsFlow(
7474
const { overageStrategy } = args;
7575

7676
// If credits are already auto-enabled (strategy='always'), the request
77-
// that just failed already included creditsthey didn't help.
78-
// Fall through to ProQuotaDialog which offers the Flash downgrade.
77+
// that just failed already included enabledCreditTypescredits didn't
78+
// help. Fall through to ProQuotaDialog which offers the Flash downgrade.
7979
if (shouldAutoUseCredits(overageStrategy, creditBalance)) {
8080
return null;
8181
}

packages/cli/src/ui/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ export type HistoryItemStats = HistoryItemQuotaBase & {
201201
type: 'stats';
202202
duration: string;
203203
quotas?: RetrieveUserQuotaResponse;
204-
/** G1 AI Credits balance, null if not eligible */
205-
creditBalance?: number | null;
204+
creditBalance?: number;
206205
};
207206

208207
export type HistoryItemModelStats = HistoryItemQuotaBase & {

packages/core/src/billing/billing.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ describe('billing', () => {
226226
});
227227

228228
it('should return true for gemini-3.1-pro-preview', () => {
229-
expect(isOverageEligibleModel('gemini-3.1-pro-preview')).toBe(false);
229+
expect(isOverageEligibleModel('gemini-3.1-pro-preview')).toBe(true);
230230
});
231231

232232
it('should return true for gemini-3.1-pro-preview-customtools', () => {

packages/core/src/billing/billing.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import type {
99
CreditType,
1010
GeminiUserTier,
1111
} from '../code_assist/types.js';
12-
import { PREVIEW_GEMINI_MODEL } from '../config/models.js';
12+
import {
13+
PREVIEW_GEMINI_MODEL,
14+
PREVIEW_GEMINI_3_1_MODEL,
15+
} from '../config/models.js';
1316

1417
/**
1518
* Strategy for handling quota exhaustion when AI credits are available.
@@ -26,7 +29,10 @@ export const G1_CREDIT_TYPE: CreditType = 'GOOGLE_ONE_AI';
2629
* The set of models that support AI credits overage billing.
2730
* Only these models are eligible for the credits-based retry flow.
2831
*/
29-
export const OVERAGE_ELIGIBLE_MODELS = new Set([PREVIEW_GEMINI_MODEL]);
32+
export const OVERAGE_ELIGIBLE_MODELS = new Set([
33+
PREVIEW_GEMINI_MODEL,
34+
PREVIEW_GEMINI_3_1_MODEL,
35+
]);
3036

3137
/**
3238
* Checks if a model is eligible for AI credits overage billing.

0 commit comments

Comments
 (0)