[PR #1455] [MERGED] lib: Context values never stored in checkpoints #2087

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraph/pull/1455
Author: @nfcampos
Created: 8/23/2024
Status: Merged
Merged: 8/23/2024
Merged by: @nfcampos

Base: mainHead: nc/23aug/some-magic-for-will


📝 Commits (5)

📊 Changes

13 files changed (+268 additions, -268 deletions)

View changed files

📝 libs/langgraph/langgraph/channels/context.py (+3 -122)
📝 libs/langgraph/langgraph/constants.py (+2 -0)
📝 libs/langgraph/langgraph/graph/state.py (+19 -14)
📝 libs/langgraph/langgraph/managed/base.py (+33 -2)
libs/langgraph/langgraph/managed/context.py (+87 -0)
📝 libs/langgraph/langgraph/managed/shared_value.py (+0 -1)
📝 libs/langgraph/langgraph/pregel/__init__.py (+39 -12)
📝 libs/langgraph/langgraph/pregel/algo.py (+24 -6)
📝 libs/langgraph/langgraph/pregel/manager.py (+27 -17)
📝 libs/langgraph/langgraph/pregel/read.py (+5 -5)
📝 libs/langgraph/tests/test_channels.py (+1 -83)
📝 libs/langgraph/tests/test_pregel.py (+15 -4)
📝 libs/langgraph/tests/test_pregel_async.py (+13 -2)

📄 Description

  • Convert Context to a ManagedValue
  • Add shim for old Context constructor
  • Add runtime flag for managed values, which, prior to serialization, replaces the value with a placeholder, and replaces it back with the actual value on resuming from checkpoint

🔄 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/1455 **Author:** [@nfcampos](https://github.com/nfcampos) **Created:** 8/23/2024 **Status:** ✅ Merged **Merged:** 8/23/2024 **Merged by:** [@nfcampos](https://github.com/nfcampos) **Base:** `main` ← **Head:** `nc/23aug/some-magic-for-will` --- ### 📝 Commits (5) - [`bc86757`](https://github.com/langchain-ai/langgraph/commit/bc86757e734e37df548e30c6066dedc1f0bc6e48) lib: Context values never stored in checkpoints - [`e089840`](https://github.com/langchain-ai/langgraph/commit/e0898409b9aa4c3f4d8cf10cae57eeb9c716f10b) Lint - [`1e6da19`](https://github.com/langchain-ai/langgraph/commit/1e6da192577060912cc37f2016412bc8cc5135fc) Update libs/langgraph/langgraph/managed/context.py - [`beafddf`](https://github.com/langchain-ai/langgraph/commit/beafddf7c86eddc3db078fe3016916f792b75d38) Lint - [`e8c553c`](https://github.com/langchain-ai/langgraph/commit/e8c553c41e0d573458361f503c7791f6d564db3a) Lint ### 📊 Changes **13 files changed** (+268 additions, -268 deletions) <details> <summary>View changed files</summary> 📝 `libs/langgraph/langgraph/channels/context.py` (+3 -122) 📝 `libs/langgraph/langgraph/constants.py` (+2 -0) 📝 `libs/langgraph/langgraph/graph/state.py` (+19 -14) 📝 `libs/langgraph/langgraph/managed/base.py` (+33 -2) ➕ `libs/langgraph/langgraph/managed/context.py` (+87 -0) 📝 `libs/langgraph/langgraph/managed/shared_value.py` (+0 -1) 📝 `libs/langgraph/langgraph/pregel/__init__.py` (+39 -12) 📝 `libs/langgraph/langgraph/pregel/algo.py` (+24 -6) 📝 `libs/langgraph/langgraph/pregel/manager.py` (+27 -17) 📝 `libs/langgraph/langgraph/pregel/read.py` (+5 -5) 📝 `libs/langgraph/tests/test_channels.py` (+1 -83) 📝 `libs/langgraph/tests/test_pregel.py` (+15 -4) 📝 `libs/langgraph/tests/test_pregel_async.py` (+13 -2) </details> ### 📄 Description - Convert Context to a ManagedValue - Add shim for old Context constructor - Add `runtime` flag for managed values, which, prior to serialization, replaces the value with a placeholder, and replaces it back with the actual value on resuming from checkpoint --- <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:46:15 -05:00
yindo closed this issue 2026-02-20 17:46:15 -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#2087