Skip to content

fix: deserialize LangChain messages in async checkpoint operations (#85, #87) #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions langgraph/checkpoint/redis/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,13 +540,13 @@ async def aget_tuple(self, config: RunnableConfig) -> Optional[CheckpointTuple]:
# Execute all tasks in parallel - pending_sends is optional
if doc_parent_checkpoint_id:
results = await asyncio.gather(*tasks)
channel_values: Dict[str, Any] = results[0]
channel_values: Dict[str, Any] = self._recursive_deserialize(results[0])
pending_sends: List[Tuple[str, Union[str, bytes]]] = results[1]
pending_writes: List[PendingWrite] = results[2]
else:
# Only channel_values and pending_writes tasks
results = await asyncio.gather(*tasks)
channel_values = results[0]
channel_values = self._recursive_deserialize(results[0])
pending_sends = []
pending_writes = results[1]

Expand Down Expand Up @@ -709,7 +709,7 @@ async def alist(
if isinstance(checkpoint_data, dict)
else orjson.loads(checkpoint_data)
)
channel_values = checkpoint_dict.get("channel_values", {})
channel_values = self._recursive_deserialize(checkpoint_dict.get("channel_values", {}))
else:
# If checkpoint data is missing, the document is corrupted
# Set empty channel values rather than attempting a fallback
Expand Down
Loading