mirror of
https://github.com/google-gemini/gemini-cli
synced 2026-04-21 13:37:17 +00:00
Merge branch 'main' into fix/signal-forwarding-relaunch
This commit is contained in:
commit
eb70e55e58
3 changed files with 58 additions and 2 deletions
|
|
@ -151,7 +151,7 @@ export async function startInteractiveUI(
|
|||
isScreenReaderEnabled: config.getScreenReader(),
|
||||
onRender: ({ renderTime }: { renderTime: number }) => {
|
||||
if (renderTime > SLOW_RENDER_MS) {
|
||||
recordSlowRender(config, renderTime);
|
||||
recordSlowRender(config, Math.round(renderTime));
|
||||
}
|
||||
profiler.reportFrameRendered();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -710,6 +710,59 @@ describe('Server Config (config.ts)', () => {
|
|||
);
|
||||
});
|
||||
|
||||
describe('getProModelNoAccessSync', () => {
|
||||
it('should return experiment value for AuthType.LOGIN_WITH_GOOGLE', async () => {
|
||||
vi.mocked(getExperiments).mockResolvedValue({
|
||||
experimentIds: [],
|
||||
flags: {
|
||||
[ExperimentFlags.PRO_MODEL_NO_ACCESS]: {
|
||||
boolValue: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
const config = new Config(baseParams);
|
||||
vi.mocked(createContentGeneratorConfig).mockResolvedValue({
|
||||
authType: AuthType.LOGIN_WITH_GOOGLE,
|
||||
});
|
||||
await config.refreshAuth(AuthType.LOGIN_WITH_GOOGLE);
|
||||
expect(config.getProModelNoAccessSync()).toBe(true);
|
||||
});
|
||||
|
||||
it('should return experiment value for AuthType.COMPUTE_ADC', async () => {
|
||||
vi.mocked(getExperiments).mockResolvedValue({
|
||||
experimentIds: [],
|
||||
flags: {
|
||||
[ExperimentFlags.PRO_MODEL_NO_ACCESS]: {
|
||||
boolValue: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
const config = new Config(baseParams);
|
||||
vi.mocked(createContentGeneratorConfig).mockResolvedValue({
|
||||
authType: AuthType.COMPUTE_ADC,
|
||||
});
|
||||
await config.refreshAuth(AuthType.COMPUTE_ADC);
|
||||
expect(config.getProModelNoAccessSync()).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for other auth types even if experiment is true', async () => {
|
||||
vi.mocked(getExperiments).mockResolvedValue({
|
||||
experimentIds: [],
|
||||
flags: {
|
||||
[ExperimentFlags.PRO_MODEL_NO_ACCESS]: {
|
||||
boolValue: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
const config = new Config(baseParams);
|
||||
vi.mocked(createContentGeneratorConfig).mockResolvedValue({
|
||||
authType: AuthType.USE_GEMINI,
|
||||
});
|
||||
await config.refreshAuth(AuthType.USE_GEMINI);
|
||||
expect(config.getProModelNoAccessSync()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getRequestTimeoutMs', () => {
|
||||
it('should return undefined if the flag is not set', () => {
|
||||
const config = new Config(baseParams);
|
||||
|
|
|
|||
|
|
@ -3160,7 +3160,10 @@ export class Config implements McpContext, AgentLoopContext {
|
|||
* Note: This method should only be called after startup, once experiments have been loaded.
|
||||
*/
|
||||
getProModelNoAccessSync(): boolean {
|
||||
if (this.contentGeneratorConfig?.authType !== AuthType.LOGIN_WITH_GOOGLE) {
|
||||
if (
|
||||
this.contentGeneratorConfig?.authType !== AuthType.LOGIN_WITH_GOOGLE &&
|
||||
this.contentGeneratorConfig?.authType !== AuthType.COMPUTE_ADC
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue