feat(core): fallback to 2.5 models with no access for toolcalls (#21283)

This commit is contained in:
Sehoon Shon
2026-03-05 15:37:15 -05:00
committed by GitHub
parent 0135b03c8a
commit 22d962e761
3 changed files with 73 additions and 8 deletions

View File

@@ -49,15 +49,16 @@ export function resolvePolicyChain(
const useCustomToolModel =
useGemini31 &&
config.getContentGeneratorConfig?.()?.authType === AuthType.USE_GEMINI;
const hasAccessToPreview = config.getHasAccessToPreviewModel?.() ?? true;
const resolvedModel = resolveModel(
modelFromConfig,
useGemini31,
useCustomToolModel,
hasAccessToPreview,
);
const isAutoPreferred = preferredModel ? isAutoModel(preferredModel) : false;
const isAutoConfigured = isAutoModel(configuredModel);
const hasAccessToPreview = config.getHasAccessToPreviewModel?.() ?? true;
if (resolvedModel === DEFAULT_GEMINI_FLASH_LITE_MODEL) {
chain = getFlashLitePolicyChain();
@@ -80,7 +81,7 @@ export function resolvePolicyChain(
} else {
// User requested Gemini 3 but has no access. Proactively downgrade
// to the stable Gemini 2.5 chain.
return getModelPolicyChain({
chain = getModelPolicyChain({
previewEnabled: false,
userTier: config.getUserTier(),
useGemini31,