mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 20:14:44 -07:00
fix(core): enable numerical routing by default and set threshold fallback to 90
This commit is contained in:
@@ -492,6 +492,43 @@ describe('Server Config (config.ts)', () => {
|
||||
expect(await config.getUserCaching()).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('getNumericalRoutingEnabled', () => {
|
||||
it('should return true by default if there are no experiments', async () => {
|
||||
const config = new Config(baseParams);
|
||||
expect(await config.getNumericalRoutingEnabled()).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true if the remote flag is set to true', async () => {
|
||||
const config = new Config({
|
||||
...baseParams,
|
||||
experiments: {
|
||||
flags: {
|
||||
[ExperimentFlags.ENABLE_NUMERICAL_ROUTING]: {
|
||||
boolValue: true,
|
||||
},
|
||||
},
|
||||
experimentIds: [],
|
||||
},
|
||||
} as unknown as ConfigParameters);
|
||||
expect(await config.getNumericalRoutingEnabled()).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false if the remote flag is explicitly set to false', async () => {
|
||||
const config = new Config({
|
||||
...baseParams,
|
||||
experiments: {
|
||||
flags: {
|
||||
[ExperimentFlags.ENABLE_NUMERICAL_ROUTING]: {
|
||||
boolValue: false,
|
||||
},
|
||||
},
|
||||
experimentIds: [],
|
||||
},
|
||||
} as unknown as ConfigParameters);
|
||||
expect(await config.getNumericalRoutingEnabled()).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('refreshAuth', () => {
|
||||
|
||||
@@ -2508,8 +2508,12 @@ export class Config implements McpContext, AgentLoopContext {
|
||||
async getNumericalRoutingEnabled(): Promise<boolean> {
|
||||
await this.ensureExperimentsLoaded();
|
||||
|
||||
return !!this.experiments?.flags[ExperimentFlags.ENABLE_NUMERICAL_ROUTING]
|
||||
?.boolValue;
|
||||
const flag =
|
||||
this.experiments?.flags[ExperimentFlags.ENABLE_NUMERICAL_ROUTING];
|
||||
if (flag?.boolValue !== undefined) {
|
||||
return flag.boolValue;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
async getClassifierThreshold(): Promise<number | undefined> {
|
||||
|
||||
Reference in New Issue
Block a user