fix(plan): isolate plan files per session (#18757)

This commit is contained in:
Adib234
2026-02-12 14:02:59 -05:00
committed by GitHub
parent d243dfce14
commit 0b3130cec7
6 changed files with 32 additions and 9 deletions
+13 -1
View File
@@ -20,11 +20,13 @@ const AGENTS_DIR_NAME = '.agents';
export class Storage {
private readonly targetDir: string;
private readonly sessionId: string | undefined;
private projectIdentifier: string | undefined;
private initPromise: Promise<void> | undefined;
constructor(targetDir: string) {
constructor(targetDir: string, sessionId?: string) {
this.targetDir = targetDir;
this.sessionId = sessionId;
}
static getGlobalGeminiDir(): string {
@@ -242,9 +244,19 @@ export class Storage {
}
getProjectTempPlansDir(): string {
if (this.sessionId) {
return path.join(this.getProjectTempDir(), this.sessionId, 'plans');
}
return path.join(this.getProjectTempDir(), 'plans');
}
getProjectTempTasksDir(): string {
if (this.sessionId) {
return path.join(this.getProjectTempDir(), this.sessionId, 'tasks');
}
return path.join(this.getProjectTempDir(), 'tasks');
}
getExtensionsDir(): string {
return path.join(this.getGeminiDir(), 'extensions');
}