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
This commit is contained in:
gemini-cli[bot]
2026-05-13 23:24:54 +00:00
parent 77078b3e8a
commit f737a7925f
2 changed files with 5 additions and 1 deletions
@@ -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', () => {
@@ -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,
}),