Tactical client lifetime fix. (#1247)
This commit is contained in:
parent
0c9b138f5e
commit
7a419282c8
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue