Skip to content

Commit 418a861

Browse files
committed
Move init.
1 parent 0308267 commit 418a861

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

packages/cli/src/core/initializer.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import { type Config } from '@google/gemini-cli-core';
7+
import {
8+
IdeClient,
9+
IdeConnectionEvent,
10+
IdeConnectionType,
11+
logIdeConnection,
12+
type Config,
13+
} from '@google/gemini-cli-core';
814
import { type LoadedSettings } from '../config/settings.js';
915
import { performInitialAuth } from './auth.js';
1016
import { validateTheme } from './theme.js';
@@ -36,6 +42,12 @@ export async function initializeApp(
3642
const shouldOpenAuthDialog =
3743
settings.merged.security?.auth?.selectedType === undefined || !!authError;
3844

45+
if (config.getIdeMode()) {
46+
const ideClient = await IdeClient.getInstance();
47+
await ideClient.connect();
48+
logIdeConnection(config, new IdeConnectionEvent(IdeConnectionType.START));
49+
}
50+
3951
return {
4052
authError,
4153
themeError,

packages/core/src/config/config.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,14 @@ import {
4848
} from './models.js';
4949
import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
5050
import type { MCPOAuthConfig } from '../mcp/oauth-provider.js';
51-
import { IdeClient } from '../ide/ide-client.js';
5251
import { ideContextStore } from '../ide/ideContext.js';
5352
import type { FileSystemService } from '../services/fileSystemService.js';
5453
import { StandardFileSystemService } from '../services/fileSystemService.js';
5554
import {
5655
logCliConfiguration,
57-
logIdeConnection,
5856
logRipgrepFallback,
5957
} from '../telemetry/loggers.js';
60-
import {
61-
IdeConnectionEvent,
62-
IdeConnectionType,
63-
RipgrepFallbackEvent,
64-
} from '../telemetry/types.js';
58+
import { RipgrepFallbackEvent } from '../telemetry/types.js';
6559
import type { FallbackModelHandler } from '../fallback/types.js';
6660
import { ModelRouterService } from '../routing/modelRouterService.js';
6761
import { OutputFormat } from '../output/types.js';
@@ -439,11 +433,6 @@ export class Config {
439433
}
440434
this.initialized = true;
441435

442-
if (this.getIdeMode()) {
443-
await (await IdeClient.getInstance()).connect();
444-
logIdeConnection(this, new IdeConnectionEvent(IdeConnectionType.START));
445-
}
446-
447436
// Initialize centralized FileDiscoveryService
448437
this.getFileService();
449438
if (this.getCheckpointingEnabled()) {

0 commit comments

Comments
 (0)