mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
perf(cli): background IDE client to speed up initialization (#23603)
This commit is contained in:
@@ -105,6 +105,9 @@ describe('initializer', () => {
|
|||||||
mockSettings,
|
mockSettings,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Wait for the background promise to resolve
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||||
|
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
authError: null,
|
authError: null,
|
||||||
accountSuspensionInfo: null,
|
accountSuspensionInfo: null,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
StartSessionEvent,
|
StartSessionEvent,
|
||||||
logCliConfiguration,
|
logCliConfiguration,
|
||||||
startupProfiler,
|
startupProfiler,
|
||||||
|
debugLogger,
|
||||||
} from '@google/gemini-cli-core';
|
} from '@google/gemini-cli-core';
|
||||||
import { type LoadedSettings } from '../config/settings.js';
|
import { type LoadedSettings } from '../config/settings.js';
|
||||||
import { performInitialAuth } from './auth.js';
|
import { performInitialAuth } from './auth.js';
|
||||||
@@ -55,9 +56,18 @@ export async function initializeApp(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (config.getIdeMode()) {
|
if (config.getIdeMode()) {
|
||||||
const ideClient = await IdeClient.getInstance();
|
IdeClient.getInstance()
|
||||||
|
.then(async (ideClient) => {
|
||||||
await ideClient.connect();
|
await ideClient.connect();
|
||||||
logIdeConnection(config, new IdeConnectionEvent(IdeConnectionType.START));
|
logIdeConnection(
|
||||||
|
config,
|
||||||
|
new IdeConnectionEvent(IdeConnectionType.START),
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
// We log locally if IDE connection setup fails in the background.
|
||||||
|
debugLogger.error('Failed to initialize IDE client:', e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user