From 17ef37c5cb5441fcacae8d4293467bffc57ad0d5 Mon Sep 17 00:00:00 2001 From: sinedied Date: Tue, 18 Nov 2025 10:35:06 +0100 Subject: [PATCH 1/2] fix(community): possible race condition --- libs/langchain-community/src/stores/message/file_system.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/langchain-community/src/stores/message/file_system.ts b/libs/langchain-community/src/stores/message/file_system.ts index 0e49b5ee95dd..8d9ceaab4944 100644 --- a/libs/langchain-community/src/stores/message/file_system.ts +++ b/libs/langchain-community/src/stores/message/file_system.ts @@ -113,7 +113,6 @@ export class FileSystemChatMessageHistory extends BaseListChatMessageHistory { protected async loadStore(): Promise { try { - await fs.access(this.filePath, fs.constants.F_OK); const store = await fs.readFile(this.filePath, "utf-8"); return JSON.parse(store) as FileChatStore; } catch (_error) { From 7d5c7922613425d6c9dd46a36b52ac1dd448a7ad Mon Sep 17 00:00:00 2001 From: sinedied Date: Tue, 18 Nov 2025 14:17:17 +0100 Subject: [PATCH 2/2] chore: add changeset --- .changeset/crisp-kiwis-end.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/crisp-kiwis-end.md diff --git a/.changeset/crisp-kiwis-end.md b/.changeset/crisp-kiwis-end.md new file mode 100644 index 000000000000..71996409dade --- /dev/null +++ b/.changeset/crisp-kiwis-end.md @@ -0,0 +1,5 @@ +--- +"@langchain/community": patch +--- + +Fix possible race condition in FileSystemChatMessageHistory