mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 11:04:42 -07:00
fix(billing): fix overage strategy lifecycle and settings integration (#21236)
This commit is contained in:
@@ -48,6 +48,7 @@ import {
|
||||
shouldAutoUseCredits,
|
||||
} from '../billing/billing.js';
|
||||
import { logBillingEvent, logInvalidChunk } from '../telemetry/loggers.js';
|
||||
import { coreEvents } from '../utils/events.js';
|
||||
import { CreditsUsedEvent } from '../telemetry/billingEvents.js';
|
||||
import {
|
||||
fromCountTokenResponse,
|
||||
@@ -100,6 +101,11 @@ export class CodeAssistServer implements ContentGenerator {
|
||||
const modelIsEligible = isOverageEligibleModel(req.model);
|
||||
const shouldEnableCredits = modelIsEligible && autoUse;
|
||||
|
||||
if (shouldEnableCredits && !this.config?.getCreditsNotificationShown()) {
|
||||
this.config?.setCreditsNotificationShown(true);
|
||||
coreEvents.emitFeedback('info', 'Using AI Credits for this request.');
|
||||
}
|
||||
|
||||
const enabledCreditTypes = shouldEnableCredits
|
||||
? ([G1_CREDIT_TYPE] as string[])
|
||||
: undefined;
|
||||
|
||||
Reference in New Issue
Block a user