From 3f2557c9c9993eecc7e7c4c288015e8618cf1ffa Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 22 Jan 2025 15:52:13 -0800 Subject: [PATCH] Fix --- libs/langgraph/langgraph/pregel/loop.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/langgraph/langgraph/pregel/loop.py b/libs/langgraph/langgraph/pregel/loop.py index 943cfdfc2b..0559b02ea3 100644 --- a/libs/langgraph/langgraph/pregel/loop.py +++ b/libs/langgraph/langgraph/pregel/loop.py @@ -567,7 +567,10 @@ def _first(self, *, input_keys: Union[str, Sequence[str]]) -> None: if scratchpad := cast( Optional[PregelScratchpad], configurable.get(CONFIG_KEY_SCRATCHPAD) ): - if scratchpad.null_resume is not None: + if ( + isinstance(scratchpad, PregelScratchpad) + and scratchpad.null_resume is not None + ): self.put_writes(NULL_TASK_ID, [(RESUME, scratchpad.null_resume)]) # map command to writes if isinstance(self.input, Command):