Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions packages/core/src/config/defaultModelConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,6 @@ export const DEFAULT_MODEL_CONFIGS: ModelConfigServiceConfig = {
},
],
},
'gemini-2.5-flash': {
default: 'gemini-2.5-flash',
contexts: [
{ condition: { useGemini3_5Flash: true }, target: 'gemini-3.5-flash' },
],
},
'gemini-3-pro-preview': {
default: 'gemini-3-pro-preview',
contexts: [
Expand Down
22 changes: 18 additions & 4 deletions packages/core/src/config/models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { describe, it, expect } from 'vitest';
import { describe, it, expect, afterEach } from 'vitest';
import {
resolveModel,
resolveClassifierModel,
Expand All @@ -19,6 +19,7 @@ import {
DEFAULT_GEMINI_FLASH_MODEL,
DEFAULT_GEMINI_3_5_FLASH_MODEL,
DEFAULT_GEMINI_FLASH_LITE_MODEL,
setFlashModels,
supportsMultimodalFunctionResponse,
GEMINI_MODEL_ALIAS_PRO,
GEMINI_MODEL_ALIAS_FLASH,
Expand Down Expand Up @@ -787,7 +788,20 @@ describe('resolveModel Gemini 3.5 Flash GA', () => {
).toBe(PREVIEW_GEMINI_FLASH_MODEL);
});

it('should resolve all but preview flash models to gemini-3.5-flash when useGemini3_5Flash is true (dynamic)', () => {
describe('explicit gemini-2.5-flash', () => {
afterEach(() => {
setFlashModels('gemini-3-flash-preview', 'gemini-2.5-flash');
});

it('should not rewrite explicitly requested gemini-2.5-flash to gemini-3.5-flash', () => {
setFlashModels('gemini-3.5-flash', 'gemini-3.5-flash');
expect(
resolveModel('gemini-2.5-flash', false, false, true, undefined, true),
).toBe('gemini-2.5-flash');
});
});

it('should resolve flash alias to gemini-3.5-flash but leave concrete models untouched (dynamic)', () => {
const mockDynamicConfig = {
getExperimentalDynamicModelConfiguration: () => true,
modelConfigService,
Expand All @@ -805,14 +819,14 @@ describe('resolveModel Gemini 3.5 Flash GA', () => {
).toBe('gemini-3.5-flash');
expect(
resolveModel(
DEFAULT_GEMINI_FLASH_MODEL,
'gemini-2.5-flash',
false,
false,
true,
mockDynamicConfig,
true,
),
).toBe('gemini-3.5-flash');
).toBe('gemini-2.5-flash');
expect(
resolveModel(
PREVIEW_GEMINI_FLASH_MODEL,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/config/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ function isFlashModel(model: string): boolean {
model === PREVIEW_GEMINI_FLASH_MODEL ||
model === DEFAULT_GEMINI_3_5_FLASH_MODEL ||
model === SECONDARY_GEMINI_3_5_FLASH_MODEL ||
model === 'flash' ||
model.endsWith('flash')
model === 'flash'
);
}

Expand Down