fix(patch): cherry-pick d96bd05 to release/v0.30.0-preview.5-pr-19867 to patch version v0.30.0-preview.5 and create version 0.30.0-preview.6 (#20112)

Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
This commit is contained in:
gemini-cli-robot
2026-02-23 20:57:13 -05:00
committed by GitHub
parent fdd96a0262
commit a24009f9c0
4 changed files with 19 additions and 1 deletions

View File

@@ -2063,6 +2063,21 @@ describe('Config Quota & Preview Model Access', () => {
expect(config.getHasAccessToPreviewModel()).toBe(true);
});
it('should update hasAccessToPreviewModel to true if quota includes Gemini 3.1 preview model', async () => {
mockCodeAssistServer.retrieveUserQuota.mockResolvedValue({
buckets: [
{
modelId: 'gemini-3.1-pro-preview',
remainingAmount: '100',
remainingFraction: 1.0,
},
],
});
await config.refreshUserQuota();
expect(config.getHasAccessToPreviewModel()).toBe(true);
});
it('should update hasAccessToPreviewModel to false if quota does not include preview model', async () => {
mockCodeAssistServer.retrieveUserQuota.mockResolvedValue({
buckets: [

View File

@@ -1467,7 +1467,8 @@ export class Config {
}
const hasAccess =
quota.buckets?.some((b) => b.modelId === PREVIEW_GEMINI_MODEL) ?? false;
quota.buckets?.some((b) => b.modelId && isPreviewModel(b.modelId)) ??
false;
this.setHasAccessToPreviewModel(hasAccess);
return quota;
} catch (e) {

View File

@@ -36,6 +36,7 @@ describe('isPreviewModel', () => {
it('should return true for preview models', () => {
expect(isPreviewModel(PREVIEW_GEMINI_MODEL)).toBe(true);
expect(isPreviewModel(PREVIEW_GEMINI_3_1_MODEL)).toBe(true);
expect(isPreviewModel(PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL)).toBe(true);
expect(isPreviewModel(PREVIEW_GEMINI_FLASH_MODEL)).toBe(true);
expect(isPreviewModel(PREVIEW_GEMINI_MODEL_AUTO)).toBe(true);
});

View File

@@ -134,6 +134,7 @@ export function isPreviewModel(model: string): boolean {
return (
model === PREVIEW_GEMINI_MODEL ||
model === PREVIEW_GEMINI_3_1_MODEL ||
model === PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL ||
model === PREVIEW_GEMINI_FLASH_MODEL ||
model === PREVIEW_GEMINI_MODEL_AUTO
);