[PR #561] [CLOSED] fix: make MemorySaver.put throw if thread_id not passed #848

Closed
opened 2026-02-15 19:16:08 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/561
Author: @benjamincburns
Created: 10/7/2024
Status: Closed

Base: mainHead: memorysaver-error-case


📝 Commits (1)

  • 323c449 fix: make MemorySaver.put throw if thread_id not passed

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 libs/checkpoint/src/memory.ts (+6 -0)

📄 Description

Found while working on #541.

Prior to this change, the value of config.configurable.thread_id was unchecked in MemorySaver.getTuple. Admittedly this is a minor problem, without this change it returns undefined rather than throwing, but throwing seems more appropriate here, as it better informs the caller that they forgot to supply a thread_id.

I also see that this value is unchecked in checkpoint-sqlite and checkpoint-mongodb, and it looks like they may behave similarly (return undefined rather than throwing), although I haven't run them against my tests to check just yet. Happy to submit a PR for those (or include them in this one) if you want this behaviour change everywhere).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraphjs/pull/561 **Author:** [@benjamincburns](https://github.com/benjamincburns) **Created:** 10/7/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `memorysaver-error-case` --- ### 📝 Commits (1) - [`323c449`](https://github.com/langchain-ai/langgraphjs/commit/323c449df3bdec9a45529ad4ec5aee865be73ed6) fix: make MemorySaver.put throw if thread_id not passed ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `libs/checkpoint/src/memory.ts` (+6 -0) </details> ### 📄 Description Found while working on #541. Prior to this change, the value of `config.configurable.thread_id` was unchecked in `MemorySaver.getTuple`. Admittedly this is a minor problem, without this change it returns `undefined` rather than throwing, but throwing seems more appropriate here, as it better informs the caller that they forgot to supply a `thread_id`. I also see that this value is unchecked in `checkpoint-sqlite` and `checkpoint-mongodb`, and it looks like they may behave similarly (return `undefined` rather than throwing), although I haven't run them against my tests to check just yet. Happy to submit a PR for those (or include them in this one) if you want this behaviour change everywhere). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 19:16:08 -05:00
yindo closed this issue 2026-02-15 19:16:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#848