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()