fix(core): ensure Vertex AI sets hasAccessToPreviewModels and remove aggressive 404 fallback revocation (#27067)

This commit is contained in:
Gal Zahavi
2026-05-14 12:42:09 -07:00
committed by GitHub
parent 6fee663ddc
commit 918d6b6085
2 changed files with 4 additions and 8 deletions
+4 -1
View File
@@ -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);
}
-7
View File
@@ -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<string | boolean | null> {
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,