From 918d6b608503a20ae5641ba9fd30b87a5bb91160 Mon Sep 17 00:00:00 2001 From: Gal Zahavi <38544478+galz10@users.noreply.github.com> Date: Thu, 14 May 2026 12:42:09 -0700 Subject: [PATCH] fix(core): ensure Vertex AI sets hasAccessToPreviewModels and remove aggressive 404 fallback revocation (#27067) --- packages/core/src/config/config.ts | 5 ++++- packages/core/src/fallback/handler.ts | 7 ------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index 21a6c7a402..5f3413b37d 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -1627,7 +1627,10 @@ export class Config implements McpContext, AgentLoopContext { this.baseLlmClient = new BaseLlmClient(this.contentGenerator, this); const authType = this.contentGeneratorConfig.authType; - if (authType === AuthType.USE_GEMINI) { + if ( + authType === AuthType.USE_GEMINI || + authType === AuthType.USE_VERTEX_AI + ) { this.setHasAccessToPreviewModel(true); } diff --git a/packages/core/src/fallback/handler.ts b/packages/core/src/fallback/handler.ts index 3e8dcc5267..5c4fbe91ff 100644 --- a/packages/core/src/fallback/handler.ts +++ b/packages/core/src/fallback/handler.ts @@ -20,8 +20,6 @@ import { applyAvailabilityTransition, } from '../availability/policyHelpers.js'; -import { isPreviewModel } from '../config/models.js'; - export const UPGRADE_URL_PAGE = 'https://goo.gle/set-up-gemini-code-assist'; export async function handleFallback( @@ -32,11 +30,6 @@ export async function handleFallback( ): Promise { const failureKind = classifyFailureKind(error); - // If a preview model is not found, record that the user lacks preview access. - if (failureKind === 'not_found' && isPreviewModel(failedModel, config)) { - config.setHasAccessToPreviewModel?.(false); - } - const chain = resolvePolicyChain(config); const { failedPolicy, candidates } = buildFallbackPolicyContext( chain,