From c326ad019da6ff2c70ec4422dde5ab04b394328a Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Thu, 27 Jun 2024 18:10:47 -0700 Subject: [PATCH] Skip bad pending sends --- libs/langgraph/langgraph/pregel/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/langgraph/langgraph/pregel/__init__.py b/libs/langgraph/langgraph/pregel/__init__.py index f34315966..784af417f 100644 --- a/libs/langgraph/langgraph/pregel/__init__.py +++ b/libs/langgraph/langgraph/pregel/__init__.py @@ -1816,6 +1816,9 @@ def _prepare_next_tasks( tasks: Union[list[PregelTaskDescription], list[PregelExecutableTask]] = [] # Consume pending packets for packet in checkpoint["pending_sends"]: + if not isinstance(packet, Send): + logger.warn(f"Ignoring invalid packet type {type(packet)} in pending sends") + continue if for_execution: if node := processes[packet.node].get_node(): writes = deque()