Tactical client lifetime fix. (#1247)

This commit is contained in:
N. Taylor Mullen 2025-06-19 19:54:36 -07:00 committed by GitHub
parent 0c9b138f5e
commit 7a419282c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 8 deletions

View File

@ -113,7 +113,7 @@ export interface ConfigParameters {
} }
export class Config { export class Config {
private toolRegistry: Promise<ToolRegistry>; private toolRegistry!: ToolRegistry;
private readonly sessionId: string; private readonly sessionId: string;
private contentGeneratorConfig!: ContentGeneratorConfig; private contentGeneratorConfig!: ContentGeneratorConfig;
private readonly embeddingModel: string; private readonly embeddingModel: string;
@ -184,8 +184,6 @@ export class Config {
setGeminiMdFilename(params.contextFileName); setGeminiMdFilename(params.contextFileName);
} }
this.toolRegistry = createToolRegistry(this);
if (this.telemetrySettings.enabled) { if (this.telemetrySettings.enabled) {
initializeTelemetry(this); initializeTelemetry(this);
} }
@ -198,10 +196,10 @@ export class Config {
); );
const gc = new GeminiClient(this); const gc = new GeminiClient(this);
await gc.initialize(contentConfig);
this.contentGeneratorConfig = contentConfig;
this.geminiClient = gc; this.geminiClient = gc;
this.toolRegistry = await createToolRegistry(this);
await gc.initialize(contentConfig);
this.contentGeneratorConfig = contentConfig;
} }
getSessionId(): string { getSessionId(): string {
@ -232,8 +230,8 @@ export class Config {
return this.targetDir; return this.targetDir;
} }
async getToolRegistry(): Promise<ToolRegistry> { getToolRegistry(): Promise<ToolRegistry> {
return this.toolRegistry; return Promise.resolve(this.toolRegistry);
} }
getDebugMode(): boolean { getDebugMode(): boolean {