Skip to content

Commit 918d6b6

Browse files
authored
fix(core): ensure Vertex AI sets hasAccessToPreviewModels and remove aggressive 404 fallback revocation (google-gemini#27067)
1 parent 6fee663 commit 918d6b6

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

packages/core/src/config/config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,10 @@ export class Config implements McpContext, AgentLoopContext {
16271627
this.baseLlmClient = new BaseLlmClient(this.contentGenerator, this);
16281628

16291629
const authType = this.contentGeneratorConfig.authType;
1630-
if (authType === AuthType.USE_GEMINI) {
1630+
if (
1631+
authType === AuthType.USE_GEMINI ||
1632+
authType === AuthType.USE_VERTEX_AI
1633+
) {
16311634
this.setHasAccessToPreviewModel(true);
16321635
}
16331636

packages/core/src/fallback/handler.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import {
2020
applyAvailabilityTransition,
2121
} from '../availability/policyHelpers.js';
2222

23-
import { isPreviewModel } from '../config/models.js';
24-
2523
export const UPGRADE_URL_PAGE = 'https://goo.gle/set-up-gemini-code-assist';
2624

2725
export async function handleFallback(
@@ -32,11 +30,6 @@ export async function handleFallback(
3230
): Promise<string | boolean | null> {
3331
const failureKind = classifyFailureKind(error);
3432

35-
// If a preview model is not found, record that the user lacks preview access.
36-
if (failureKind === 'not_found' && isPreviewModel(failedModel, config)) {
37-
config.setHasAccessToPreviewModel?.(false);
38-
}
39-
4033
const chain = resolvePolicyChain(config);
4134
const { failedPolicy, candidates } = buildFallbackPolicyContext(
4235
chain,

0 commit comments

Comments
 (0)