From cbbfaba1fd85bd708942f763079b380714de051e Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Tue, 8 Apr 2025 14:07:08 -0700 Subject: [PATCH] Add comments --- libs/langgraph/langgraph/pregel/loop.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/langgraph/langgraph/pregel/loop.py b/libs/langgraph/langgraph/pregel/loop.py index 772564a50..e1de05602 100644 --- a/libs/langgraph/langgraph/pregel/loop.py +++ b/libs/langgraph/langgraph/pregel/loop.py @@ -296,6 +296,8 @@ class PregelLoop(LoopProtocol): """Put writes for a task, to be read by the next tick.""" if not writes: return + # always checkpoint writes containing Send, as they are fetched from the + # parent checkpoint, not the current one checkpoint_during = self.checkpoint_during or any(w[0] == TASKS for w in writes) # deduplicate writes to special channels, last write wins if all(w[0] in WRITES_IDX_MAP for w in writes): @@ -789,6 +791,7 @@ class PregelLoop(LoopProtocol): **self.checkpoint_config, CONF: { **self.checkpoint_config[CONF], + # this is guaranteed to be set by code above CONFIG_KEY_CHECKPOINT_ID: self.checkpoint_id_prev, CONFIG_KEY_CHECKPOINT_NS: self.config[CONF].get( CONFIG_KEY_CHECKPOINT_NS, ""