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
@@ -154,12 +154,24 @@ describe('Storage additional helpers', () => {
expect(Storage.getGlobalBinDir()).toBe(expected);
});
it('getProjectTempPlansDir returns ~/.gemini/tmp/<identifier>/plans', async () => {
it('getProjectTempPlansDir returns ~/.gemini/tmp/<identifier>/plans when no sessionId is provided', async () => {
await storage.initialize();
const tempDir = storage.getProjectTempDir();
const expected = path.join(tempDir, 'plans');
expect(storage.getProjectTempPlansDir()).toBe(expected);
});
it('getProjectTempPlansDir returns ~/.gemini/tmp/<identifier>/<sessionId>/plans when sessionId is provided', async () => {
const sessionId = 'test-session-id';
const storageWithSession = new Storage(projectRoot, sessionId);
ProjectRegistry.prototype.getShortId = vi
.fn()
.mockReturnValue(PROJECT_SLUG);
await storageWithSession.initialize();
const tempDir = storageWithSession.getProjectTempDir();
const expected = path.join(tempDir, sessionId, 'plans');
expect(storageWithSession.getProjectTempPlansDir()).toBe(expected);
});
});
describe('Storage - System Paths', () => {