From eeaac6d80d7ede7f84378f55087f3ade9c1682ac Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Wed, 4 Mar 2026 13:26:31 -0800 Subject: [PATCH] update comments --- libs/langgraph/langgraph/pregel/_loop.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/libs/langgraph/langgraph/pregel/_loop.py b/libs/langgraph/langgraph/pregel/_loop.py index ea7a808d4..b8c6cf088 100644 --- a/libs/langgraph/langgraph/pregel/_loop.py +++ b/libs/langgraph/langgraph/pregel/_loop.py @@ -1109,12 +1109,11 @@ class SyncPregelLoop(PregelLoop, AbstractContextManager): if saved.pending_writes is not None else [] ) - # When re-invoking from a specific checkpoint (not skip_done_tasks) - # that isn't a subgraph being resumed by its parent (CONFIG_KEY_RESUMING), - # clear cached RESUME writes so that interrupt() re-fires instead of - # returning stale cached values. This mirrors the behavior of fork - # checkpoints created via update_state, which start with no writes. - # Command(resume=...) will add its own fresh RESUME writes in _first(). + # When resuming from a specific checkpoint_id (skip_done_tasks=False) + # and this is NOT a subgraph being resumed by its parent graph + # (CONFIG_KEY_RESUMING), drop stale RESUME writes so that interrupt() + # calls re-fire instead of returning cached values. + # Command(resume=...) will supply fresh RESUME writes in _first(). if not self.skip_done_tasks and CONFIG_KEY_RESUMING not in self.config.get( CONF, {} ): @@ -1300,12 +1299,11 @@ class AsyncPregelLoop(PregelLoop, AbstractAsyncContextManager): if saved.pending_writes is not None else [] ) - # When re-invoking from a specific checkpoint (not skip_done_tasks) - # that isn't a subgraph being resumed by its parent (CONFIG_KEY_RESUMING), - # clear cached RESUME writes so that interrupt() re-fires instead of - # returning stale cached values. This mirrors the behavior of fork - # checkpoints created via update_state, which start with no writes. - # Command(resume=...) will add its own fresh RESUME writes in _first(). + # When resuming from a specific checkpoint_id (skip_done_tasks=False) + # and this is NOT a subgraph being resumed by its parent graph + # (CONFIG_KEY_RESUMING), drop stale RESUME writes so that interrupt() + # calls re-fire instead of returning cached values. + # Command(resume=...) will supply fresh RESUME writes in _first(). if not self.skip_done_tasks and CONFIG_KEY_RESUMING not in self.config.get( CONF, {} ):