Introduce IDE mode installer (#4877)

This commit is contained in:
christine betts
2025-07-30 21:26:31 +00:00
committed by GitHub
parent c1fe688956
commit 7bc8766542
18 changed files with 433 additions and 277 deletions

View File

@@ -18,6 +18,7 @@ import {
} from '../core/contentGenerator.js';
import { GeminiClient } from '../core/client.js';
import { GitService } from '../services/gitService.js';
import { IdeClient } from '../ide/ide-client.js';
vi.mock('fs', async (importOriginal) => {
const actual = await importOriginal<typeof import('fs')>();
@@ -119,6 +120,7 @@ describe('Server Config (config.ts)', () => {
telemetry: TELEMETRY_SETTINGS,
sessionId: SESSION_ID,
model: MODEL,
ideClient: IdeClient.getInstance(false),
};
beforeEach(() => {

View File

@@ -185,7 +185,7 @@ export interface ConfigParameters {
noBrowser?: boolean;
summarizeToolOutput?: Record<string, SummarizeToolOutputSettings>;
ideMode?: boolean;
ideClient?: IdeClient;
ideClient: IdeClient;
}
export class Config {
@@ -229,7 +229,7 @@ export class Config {
private readonly extensionContextFilePaths: string[];
private readonly noBrowser: boolean;
private readonly ideMode: boolean;
private readonly ideClient: IdeClient | undefined;
private readonly ideClient: IdeClient;
private inFallbackMode = false;
private readonly maxSessionTurns: number;
private readonly listExtensions: boolean;
@@ -593,7 +593,7 @@ export class Config {
return this.ideMode;
}
getIdeClient(): IdeClient | undefined {
getIdeClient(): IdeClient {
return this.ideClient;
}

View File

@@ -7,6 +7,7 @@
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { Config } from './config.js';
import { DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL } from './models.js';
import { IdeClient } from '../ide/ide-client.js';
import fs from 'node:fs';
vi.mock('node:fs');
@@ -25,6 +26,7 @@ describe('Flash Model Fallback Configuration', () => {
debugMode: false,
cwd: '/test',
model: DEFAULT_GEMINI_MODEL,
ideClient: IdeClient.getInstance(false),
});
// Initialize contentGeneratorConfig for testing
@@ -49,6 +51,7 @@ describe('Flash Model Fallback Configuration', () => {
debugMode: false,
cwd: '/test',
model: DEFAULT_GEMINI_MODEL,
ideClient: IdeClient.getInstance(false),
});
// Should not crash when contentGeneratorConfig is undefined
@@ -72,6 +75,7 @@ describe('Flash Model Fallback Configuration', () => {
debugMode: false,
cwd: '/test',
model: 'custom-model',
ideClient: IdeClient.getInstance(false),
});
expect(newConfig.getModel()).toBe('custom-model');