mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-22 15:51:18 -07:00
feat(plan): support automatic model switching for Plan Mode (#20240)
This commit is contained in:
@@ -2533,6 +2533,29 @@ describe('Config Quota & Preview Model Access', () => {
|
||||
expect(config.isPlanEnabled()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getPlanModeRoutingEnabled', () => {
|
||||
it('should default to true when not provided', async () => {
|
||||
const config = new Config(baseParams);
|
||||
expect(await config.getPlanModeRoutingEnabled()).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true when explicitly enabled in planSettings', async () => {
|
||||
const config = new Config({
|
||||
...baseParams,
|
||||
planSettings: { modelRouting: true },
|
||||
});
|
||||
expect(await config.getPlanModeRoutingEnabled()).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false when explicitly disabled in planSettings', async () => {
|
||||
const config = new Config({
|
||||
...baseParams,
|
||||
planSettings: { modelRouting: false },
|
||||
});
|
||||
expect(await config.getPlanModeRoutingEnabled()).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Config JIT Initialization', () => {
|
||||
|
||||
@@ -153,6 +153,7 @@ export interface SummarizeToolOutputSettings {
|
||||
|
||||
export interface PlanSettings {
|
||||
directory?: string;
|
||||
modelRouting?: boolean;
|
||||
}
|
||||
|
||||
export interface TelemetrySettings {
|
||||
@@ -734,6 +735,7 @@ export class Config {
|
||||
private readonly experimentalJitContext: boolean;
|
||||
private readonly disableLLMCorrection: boolean;
|
||||
private readonly planEnabled: boolean;
|
||||
private readonly planModeRoutingEnabled: boolean;
|
||||
private readonly modelSteering: boolean;
|
||||
private contextManager?: ContextManager;
|
||||
private terminalBackground: string | undefined = undefined;
|
||||
@@ -823,6 +825,7 @@ export class Config {
|
||||
this.agents = params.agents ?? {};
|
||||
this.disableLLMCorrection = params.disableLLMCorrection ?? true;
|
||||
this.planEnabled = params.plan ?? false;
|
||||
this.planModeRoutingEnabled = params.planSettings?.modelRouting ?? true;
|
||||
this.enableEventDrivenScheduler = params.enableEventDrivenScheduler ?? true;
|
||||
this.skillsSupport = params.skillsSupport ?? true;
|
||||
this.disabledSkills = params.disabledSkills ?? [];
|
||||
@@ -2318,6 +2321,10 @@ export class Config {
|
||||
return this.experiments?.flags[ExperimentFlags.USER_CACHING]?.boolValue;
|
||||
}
|
||||
|
||||
async getPlanModeRoutingEnabled(): Promise<boolean> {
|
||||
return this.planModeRoutingEnabled;
|
||||
}
|
||||
|
||||
async getNumericalRoutingEnabled(): Promise<boolean> {
|
||||
await this.ensureExperimentsLoaded();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user