Skip to content

Commit 86c2f43

Browse files
authored
Revert "Per-Auth Method Feature Flag for Model Routing (#11333)" (#11597)
1 parent 08192b1 commit 86c2f43

3 files changed

Lines changed: 13 additions & 57 deletions

File tree

packages/cli/src/config/config.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ vi.mock('@google/gemini-cli-core', async () => {
8585
const actualServer = await vi.importActual<typeof ServerConfig>(
8686
'@google/gemini-cli-core',
8787
);
88-
8988
return {
9089
...actualServer,
9190
IdeClient: {

packages/core/src/config/config.test.ts

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -574,52 +574,27 @@ describe('Server Config (config.ts)', () => {
574574
});
575575
});
576576

577-
describe('Model Router with Auth', () => {
578-
it('should disable model router by default for oauth-personal', async () => {
579-
const config = new Config({
580-
...baseParams,
581-
useModelRouter: true,
582-
});
583-
await config.refreshAuth(AuthType.LOGIN_WITH_GOOGLE);
584-
expect(config.getUseModelRouter()).toBe(false);
585-
});
586-
587-
it('should enable model router by default for other auth types', async () => {
588-
const config = new Config({
589-
...baseParams,
590-
useModelRouter: true,
591-
});
592-
await config.refreshAuth(AuthType.USE_GEMINI);
593-
expect(config.getUseModelRouter()).toBe(true);
594-
});
595-
596-
it('should disable model router for specified auth type', async () => {
597-
const config = new Config({
598-
...baseParams,
599-
useModelRouter: true,
600-
disableModelRouterForAuth: [AuthType.USE_GEMINI],
601-
});
602-
await config.refreshAuth(AuthType.USE_GEMINI);
577+
describe('UseModelRouter Configuration', () => {
578+
it('should default useModelRouter to false when not provided', () => {
579+
const config = new Config(baseParams);
603580
expect(config.getUseModelRouter()).toBe(false);
604581
});
605582

606-
it('should enable model router for other auth type', async () => {
607-
const config = new Config({
583+
it('should set useModelRouter to true when provided as true', () => {
584+
const paramsWithModelRouter: ConfigParameters = {
608585
...baseParams,
609586
useModelRouter: true,
610-
disableModelRouterForAuth: [],
611-
});
612-
await config.refreshAuth(AuthType.LOGIN_WITH_GOOGLE);
587+
};
588+
const config = new Config(paramsWithModelRouter);
613589
expect(config.getUseModelRouter()).toBe(true);
614590
});
615591

616-
it('should keep model router disabled when useModelRouter is false', async () => {
617-
const config = new Config({
592+
it('should set useModelRouter to false when explicitly provided as false', () => {
593+
const paramsWithModelRouter: ConfigParameters = {
618594
...baseParams,
619595
useModelRouter: false,
620-
disableModelRouterForAuth: [AuthType.USE_GEMINI],
621-
});
622-
await config.refreshAuth(AuthType.LOGIN_WITH_GOOGLE);
596+
};
597+
const config = new Config(paramsWithModelRouter);
623598
expect(config.getUseModelRouter()).toBe(false);
624599
});
625600
});

packages/core/src/config/config.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import {
4747
DEFAULT_GEMINI_EMBEDDING_MODEL,
4848
DEFAULT_GEMINI_FLASH_MODEL,
4949
DEFAULT_GEMINI_MODEL,
50-
DEFAULT_GEMINI_MODEL_AUTO,
5150
DEFAULT_THINKING_MODE,
5251
} from './models.js';
5352
import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
@@ -279,7 +278,6 @@ export interface ConfigParameters {
279278
policyEngineConfig?: PolicyEngineConfig;
280279
output?: OutputSettings;
281280
useModelRouter?: boolean;
282-
disableModelRouterForAuth?: AuthType[];
283281
enableMessageBusIntegration?: boolean;
284282
codebaseInvestigatorSettings?: CodebaseInvestigatorSettings;
285283
continueOnFailedApiCall?: boolean;
@@ -376,9 +374,7 @@ export class Config {
376374
private readonly messageBus: MessageBus;
377375
private readonly policyEngine: PolicyEngine;
378376
private readonly outputSettings: OutputSettings;
379-
private useModelRouter: boolean;
380-
private readonly initialUseModelRouter: boolean;
381-
private readonly disableModelRouterForAuth?: AuthType[];
377+
private readonly useModelRouter: boolean;
382378
private readonly enableMessageBusIntegration: boolean;
383379
private readonly codebaseInvestigatorSettings: CodebaseInvestigatorSettings;
384380
private readonly continueOnFailedApiCall: boolean;
@@ -474,11 +470,7 @@ export class Config {
474470
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
475471
this.useSmartEdit = params.useSmartEdit ?? true;
476472
this.useWriteTodos = params.useWriteTodos ?? false;
477-
this.initialUseModelRouter = params.useModelRouter ?? false;
478-
this.useModelRouter = this.initialUseModelRouter;
479-
this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? [
480-
AuthType.LOGIN_WITH_GOOGLE,
481-
];
473+
this.useModelRouter = params.useModelRouter ?? false;
482474
this.enableMessageBusIntegration =
483475
params.enableMessageBusIntegration ?? false;
484476
this.codebaseInvestigatorSettings = {
@@ -549,16 +541,6 @@ export class Config {
549541
}
550542

551543
async refreshAuth(authMethod: AuthType) {
552-
this.useModelRouter = this.initialUseModelRouter;
553-
if (this.disableModelRouterForAuth?.includes(authMethod)) {
554-
this.useModelRouter = false;
555-
if (this.model === DEFAULT_GEMINI_MODEL_AUTO) {
556-
this.model = DEFAULT_GEMINI_MODEL;
557-
}
558-
} else {
559-
this.model = DEFAULT_GEMINI_MODEL_AUTO;
560-
}
561-
562544
// Vertex and Genai have incompatible encryption and sending history with
563545
// thoughtSignature from Genai to Vertex will fail, we need to strip them
564546
if (

0 commit comments

Comments
 (0)