mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 06:12:50 -07:00
fix(core): ensure Vertex AI sets hasAccessToPreviewModels and remove aggressive 404 fallback revocation (#27067)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user