Skip to content

Commit 76f9fc8

Browse files
bsboddenCopilot
andauthored
Update langgraph/checkpoint/redis/shallow.py
Co-authored-by: Copilot <[email protected]>
1 parent 18bd20e commit 76f9fc8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

langgraph/checkpoint/redis/shallow.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,13 @@ def _deserialize_channel_values_inline(
448448

449449
if type_name and type_name != "empty" and blob_data is not None:
450450
# Create cache key based on channel, type, and data hash
451-
cache_key = f"{channel}:{type_name}:{hash(blob_data)}"
451+
# Use a stable hash for cache key
452+
if isinstance(blob_data, str):
453+
blob_bytes = blob_data.encode("utf-8")
454+
else:
455+
blob_bytes = blob_data
456+
blob_hash = hashlib.md5(blob_bytes).hexdigest()
457+
cache_key = f"{channel}:{type_name}:{blob_hash}"
452458

453459
# Check cache first
454460
if cache_key in self._channel_cache:

0 commit comments

Comments
 (0)