mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-17 00:31:44 -07:00
fix(core): prevent model router from overriding explicit model choice (#12399)
This commit is contained in:
@@ -634,6 +634,19 @@ describe('Server Config (config.ts)', () => {
|
||||
expect(config.getUseModelRouter()).toBe(true);
|
||||
expect(config.getModel()).toBe(chosenModel);
|
||||
});
|
||||
|
||||
it('should NOT switch to auto model if cli provides specific model, even if router is enabled', async () => {
|
||||
const config = new Config({
|
||||
...baseParams,
|
||||
useModelRouter: true,
|
||||
model: 'gemini-flash-latest',
|
||||
});
|
||||
|
||||
await config.refreshAuth(AuthType.LOGIN_WITH_GOOGLE);
|
||||
|
||||
expect(config.getUseModelRouter()).toBe(true);
|
||||
expect(config.getModel()).toBe('gemini-flash-latest');
|
||||
});
|
||||
});
|
||||
|
||||
describe('ContinueOnFailedApiCall Configuration', () => {
|
||||
|
||||
@@ -562,8 +562,6 @@ export class Config {
|
||||
if (this.model === DEFAULT_GEMINI_MODEL_AUTO) {
|
||||
this.model = DEFAULT_GEMINI_MODEL;
|
||||
}
|
||||
} else if (this.useModelRouter && this.model === DEFAULT_GEMINI_MODEL) {
|
||||
this.model = DEFAULT_GEMINI_MODEL_AUTO;
|
||||
}
|
||||
|
||||
// Vertex and Genai have incompatible encryption and sending history with
|
||||
|
||||
Reference in New Issue
Block a user