From cbad17fa7d4300eca86fffbdc4c4a5a3cbc61950 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 22 Jan 2025 15:51:11 -0800 Subject: [PATCH] Fix --- libs/langgraph/langgraph/pregel/loop.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/langgraph/langgraph/pregel/loop.py b/libs/langgraph/langgraph/pregel/loop.py index 9496847ca..943cfdfc2 100644 --- a/libs/langgraph/langgraph/pregel/loop.py +++ b/libs/langgraph/langgraph/pregel/loop.py @@ -228,7 +228,9 @@ class PregelLoop(LoopProtocol): if self.stream is not None and CONFIG_KEY_STREAM in config[CONF]: self.stream = DuplexStream(self.stream, config[CONF][CONFIG_KEY_STREAM]) scratchpad: Optional[PregelScratchpad] = config[CONF].get(CONFIG_KEY_SCRATCHPAD) - if not self.config[CONF].get(CONFIG_KEY_DELEGATE) and scratchpad is not None: + if not self.config[CONF].get(CONFIG_KEY_DELEGATE) and isinstance( + scratchpad, PregelScratchpad + ): if scratchpad.subgraph_counter: self.config = patch_configurable( self.config,