Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/core/src/config/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2116,6 +2116,21 @@
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',

Check warning on line 2123 in packages/core/src/config/config.test.ts

View workflow job for this annotation

GitHub Actions / Lint

Found sensitive keyword "gemini-3.1". Please make sure this change is appropriate to submit.
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: [
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,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;
Comment thread
bdmorgan marked this conversation as resolved.
this.setHasAccessToPreviewModel(hasAccess);
return quota;
} catch (e) {
Expand Down
Loading