Skip to content

Commit 97986bc

Browse files
committed
fix file storeage bug
1 parent 5306f2f commit 97986bc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

front_end/panels/ai_chat/tools/FileStorageManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export class FileStorageManager {
4949
private dbInitializationPromise: Promise<IDBDatabase> | null = null;
5050

5151
private constructor() {
52-
this.sessionId = 'default'; // Will be set to conversation ID when conversation is created/loaded
53-
logger.info('Initialized FileStorageManager with default session');
52+
this.sessionId = `temp-${this.generateUUID()}`; // Unique per session, will be set to conversation ID when conversation is created/loaded
53+
logger.info('Initialized FileStorageManager with session', { sessionId: this.sessionId });
5454
}
5555

5656
static getInstance(): FileStorageManager {

front_end/panels/ai_chat/ui/AIChatPanel.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,10 +1837,11 @@ export class AIChatPanel extends UI.Panel.Panel {
18371837
this.#isProcessing = false;
18381838
this.#selectedAgentType = null; // Reset selected agent type
18391839

1840-
// Reset file storage session ID to default for new chat
1840+
// Reset file storage session ID to a new unique ID for new chat
18411841
const {FileStorageManager} = await import('../tools/FileStorageManager.js');
1842-
FileStorageManager.getInstance().setSessionId('default');
1843-
logger.info('Reset file storage sessionId to default for new chat');
1842+
const newSessionId = `temp-${crypto.randomUUID()}`;
1843+
FileStorageManager.getInstance().setSessionId(newSessionId);
1844+
logger.info('Set file storage sessionId for new chat', { sessionId: newSessionId });
18441845

18451846
// Create new EvaluationAgent for new chat session
18461847
this.#createEvaluationAgentIfNeeded();

0 commit comments

Comments
 (0)