fix(core): ensure directory exists before writing conversation file (#18429)

Co-authored-by: godwiniheuwa <godwiniheuwa@users.noreply.github.com>
Co-authored-by: ruintheextinct <deepkarma001@gmail.com>
This commit is contained in:
Godwin Iheuwa
2026-02-18 21:13:54 +00:00
committed by GitHub
parent 0fa9e58ef8
commit 2f252a6657
2 changed files with 34 additions and 0 deletions
@@ -455,6 +455,8 @@ export class ChatRecordingService {
conversation.lastUpdated = new Date().toISOString();
const newContent = JSON.stringify(conversation, null, 2);
this.cachedLastConvData = newContent;
// Ensure directory exists before writing (handles cases where temp dir was cleaned)
fs.mkdirSync(path.dirname(this.conversationFile), { recursive: true });
fs.writeFileSync(this.conversationFile, newContent);
}
} catch (error) {