[PR #976] [MERGED] lib: Checkpoint pending writes whenever a node finishes #1808

Closed
opened 2026-02-20 17:45:36 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraph/pull/976
Author: @nfcampos
Created: 7/9/2024
Status: Merged
Merged: 7/10/2024
Merged by: @nfcampos

Base: mainHead: nc/9jul/checkpoint-pending-writes


📝 Commits (9)

📊 Changes

10 files changed (+614 additions, -124 deletions)

View changed files

📝 libs/langgraph/langgraph/checkpoint/aiosqlite.py (+90 -47)
📝 libs/langgraph/langgraph/checkpoint/base.py (+22 -0)
📝 libs/langgraph/langgraph/checkpoint/memory.py (+44 -1)
📝 libs/langgraph/langgraph/checkpoint/sqlite.py (+66 -34)
📝 libs/langgraph/langgraph/pregel/__init__.py (+101 -29)
📝 libs/langgraph/langgraph/pregel/debug.py (+3 -3)
📝 libs/langgraph/langgraph/pregel/io.py (+2 -2)
📝 libs/langgraph/langgraph/pregel/types.py (+1 -0)
📝 libs/langgraph/tests/test_pregel.py (+133 -3)
📝 libs/langgraph/tests/test_pregel_async.py (+152 -5)

📄 Description

  • Whenever a node finishes, checkpoint pending writes
  • Use pending_writes at beginning of stream (where we deal with input writes?)
  • Add test for two concurrent nodes, the longer one fails, the shorter one isn't re-run on resume
  • in sqlite/aiosqlite savers read pending writes in get_tuple

🔄 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/langgraph/pull/976 **Author:** [@nfcampos](https://github.com/nfcampos) **Created:** 7/9/2024 **Status:** ✅ Merged **Merged:** 7/10/2024 **Merged by:** [@nfcampos](https://github.com/nfcampos) **Base:** `main` ← **Head:** `nc/9jul/checkpoint-pending-writes` --- ### 📝 Commits (9) - [`f1aacf6`](https://github.com/langchain-ai/langgraph/commit/f1aacf68a8dff579fbc204116d4c7ddeb47e7e1c) lib: Checkpoint pending writes whenever a node finishes - [`fbe40cd`](https://github.com/langchain-ai/langgraph/commit/fbe40cdda6a6db65d02dedee21743153c943ac74) Rename arg - [`83562c2`](https://github.com/langchain-ai/langgraph/commit/83562c2cc52f916bab37d348a84743ac1d44eec9) Add tests, resume from pending writes - [`fa743a9`](https://github.com/langchain-ai/langgraph/commit/fa743a9d9e98e3d344dc4733f8a233e1eeac9e94) Add comment - [`9be374f`](https://github.com/langchain-ai/langgraph/commit/9be374f1c4835d50b7cf4e760175fa5885b18382) Add descriptive error - [`7afb3fe`](https://github.com/langchain-ai/langgraph/commit/7afb3fe6711ac7bb939da3a450c0ccbbeefd0612) Fix bug found by will - [`ca7041f`](https://github.com/langchain-ai/langgraph/commit/ca7041ffc10f56a4f45d7781a80cf6c24bc8b971) Fix comments - [`2df8ab8`](https://github.com/langchain-ai/langgraph/commit/2df8ab85e1c4c21e73fe06f7a1f645483c2c9f8c) Lint - [`f93e306`](https://github.com/langchain-ai/langgraph/commit/f93e306dfdc16019143dde57a950e868bf44dd37) Don't save pending write if executing only one node in step ### 📊 Changes **10 files changed** (+614 additions, -124 deletions) <details> <summary>View changed files</summary> 📝 `libs/langgraph/langgraph/checkpoint/aiosqlite.py` (+90 -47) 📝 `libs/langgraph/langgraph/checkpoint/base.py` (+22 -0) 📝 `libs/langgraph/langgraph/checkpoint/memory.py` (+44 -1) 📝 `libs/langgraph/langgraph/checkpoint/sqlite.py` (+66 -34) 📝 `libs/langgraph/langgraph/pregel/__init__.py` (+101 -29) 📝 `libs/langgraph/langgraph/pregel/debug.py` (+3 -3) 📝 `libs/langgraph/langgraph/pregel/io.py` (+2 -2) 📝 `libs/langgraph/langgraph/pregel/types.py` (+1 -0) 📝 `libs/langgraph/tests/test_pregel.py` (+133 -3) 📝 `libs/langgraph/tests/test_pregel_async.py` (+152 -5) </details> ### 📄 Description - Whenever a node finishes, checkpoint pending writes - [x] Use pending_writes at beginning of stream (where we deal with input writes?) - [x] Add test for two concurrent nodes, the longer one fails, the shorter one isn't re-run on resume - [x] in sqlite/aiosqlite savers read pending writes in get_tuple --- <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-20 17:45:36 -05:00
yindo closed this issue 2026-02-20 17:45:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#1808