Skip to content

Commit 77e65c0

Browse files
authored
fix(core): use hasAccessToPreview for auto model resolution and fix disappearing models (google-gemini#27112)
1 parent b36788e commit 77e65c0

3 files changed

Lines changed: 1 addition & 3 deletions

File tree

packages/core/src/config/config.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2019,7 +2019,6 @@ describe('Server Config (config.ts)', () => {
20192019
expect(configInternal.lastEmittedQuotaRemaining).toBeUndefined();
20202020
expect(configInternal.lastEmittedQuotaLimit).toBeUndefined();
20212021
expect(configInternal.lastQuotaFetchTime).toBe(0);
2022-
expect(configInternal.hasAccessToPreviewModel).toBeNull();
20232022

20242023
// Event emission
20252024
expect(emitQuotaSpy).toHaveBeenCalledWith(undefined, undefined, undefined);

packages/core/src/config/config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,6 @@ export class Config implements McpContext, AgentLoopContext {
18331833
this.modelQuotas.clear();
18341834
this.lastRetrievedQuota = undefined;
18351835
this.lastQuotaFetchTime = 0;
1836-
this.hasAccessToPreviewModel = null;
18371836

18381837
// Force an event emission to clear the UI display
18391838
coreEvents.emitQuotaChanged(undefined, undefined, undefined);

packages/core/src/config/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export function resolveModel(
164164
switch (normalizedModel) {
165165
case GEMINI_MODEL_ALIAS_AUTO:
166166
case GEMINI_MODEL_ALIAS_PRO: {
167-
if (currentReleaseChannel === 'stable') {
167+
if (!hasAccessToPreview) {
168168
resolved = DEFAULT_GEMINI_MODEL;
169169
break;
170170
}

0 commit comments

Comments
 (0)