mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-24 18:27:01 -07:00
fix(core): add gemini-2.5-flash-lite to default fallback policy chain
This PR adds `gemini-2.5-flash-lite` to the default model policy chain as the final fallback model. Previously, the chain stopped at `gemini-2.5-flash`, which meant that free-tier users who exhausted their Pro and Flash quotas would see a `QUOTA_EXHAUSTED` error even if they had remaining capacity on Flash-Lite (which has a much higher daily quota). Changes: - Updated `getModelPolicyChain` in `packages/core/src/availability/policyCatalog.ts` to include `DEFAULT_GEMINI_FLASH_LITE_MODEL` as the `isLastResort` policy. - Updated the previous last resort (`DEFAULT_GEMINI_FLASH_MODEL`) to no longer be marked as such. - Updated unit tests in `packages/core/src/availability/policyCatalog.test.ts` to verify the new chain order and length. Fixes: #26841 cc @adamfweidman
This commit is contained in:
@@ -11,6 +11,8 @@ import {
|
||||
validateModelPolicyChain,
|
||||
} from './policyCatalog.js';
|
||||
import {
|
||||
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
||||
DEFAULT_GEMINI_FLASH_MODEL,
|
||||
DEFAULT_GEMINI_MODEL,
|
||||
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
||||
PREVIEW_GEMINI_3_1_MODEL,
|
||||
@@ -50,7 +52,9 @@ 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[1]?.model).toBe(DEFAULT_GEMINI_FLASH_MODEL);
|
||||
expect(chain[2]?.model).toBe(DEFAULT_GEMINI_FLASH_LITE_MODEL);
|
||||
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,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user