From f737a7925fa673ca9628628fc220224491e44536 Mon Sep 17 00:00:00 2001 From: "gemini-cli[bot]" Date: Wed, 13 May 2026 23:24:54 +0000 Subject: [PATCH] fix(core): add gemini-2.5-flash-lite to default fallback chain This PR updates the default model policy chain to include `gemini-2.5-flash-lite` as the final resort. Currently, the chain only includes `gemini-2.5-pro` and `gemini-2.5-flash`. Free-tier users have significantly more quota (1,000 RPD) for Flash-Lite compared to Pro (100 RPD) and Flash (250 RPD). When both Pro and Flash quotas are exhausted, the CLI fails hard despite available Flash-Lite capacity. Changes: - Updated `getModelPolicyChain` in `packages/core/src/availability/policyCatalog.ts` to include `DEFAULT_GEMINI_FLASH_LITE_MODEL`. - Updated tests in `packages/core/src/availability/policyCatalog.test.ts` to reflect the new chain length. Fixes #26841 cc @adamfweidman @davidapierce --- packages/core/src/availability/policyCatalog.test.ts | 2 +- packages/core/src/availability/policyCatalog.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/src/availability/policyCatalog.test.ts b/packages/core/src/availability/policyCatalog.test.ts index 04e35018d5..d57d9c139f 100644 --- a/packages/core/src/availability/policyCatalog.test.ts +++ b/packages/core/src/availability/policyCatalog.test.ts @@ -50,7 +50,7 @@ describe('policyCatalog', () => { it('returns default chain when preview disabled', () => { const chain = getModelPolicyChain({ previewEnabled: false }); expect(chain[0]?.model).toBe(DEFAULT_GEMINI_MODEL); - expect(chain).toHaveLength(2); + expect(chain).toHaveLength(3); }); it('marks preview transients as sticky retries when auto-selected', () => { diff --git a/packages/core/src/availability/policyCatalog.ts b/packages/core/src/availability/policyCatalog.ts index a5694e94b8..811c81fa87 100644 --- a/packages/core/src/availability/policyCatalog.ts +++ b/packages/core/src/availability/policyCatalog.ts @@ -122,6 +122,10 @@ export function getModelPolicyChain( }), definePolicy({ model: DEFAULT_GEMINI_FLASH_MODEL, + maxAttempts: 10, + }), + definePolicy({ + model: DEFAULT_GEMINI_FLASH_LITE_MODEL, isLastResort: true, maxAttempts: 10, }),