From b5437528784ba9af7ee26092dbc39a36c06fb10f Mon Sep 17 00:00:00 2001 From: Harrison Chase Date: Sun, 7 Sep 2025 06:42:11 -0700 Subject: [PATCH] chore: update emphemeral local (#6091) basically - for conditional edges, we use this to merge the updates from state with the state object (before the actual update really occurs in the tick.after) otherwise - an emphemeral value will actually last through the logic in the conditional edge of the node after --- libs/langgraph/langgraph/pregel/_algo.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/langgraph/langgraph/pregel/_algo.py b/libs/langgraph/langgraph/pregel/_algo.py index 2405d3d81..9c29288bc 100644 --- a/libs/langgraph/langgraph/pregel/_algo.py +++ b/libs/langgraph/langgraph/pregel/_algo.py @@ -194,15 +194,12 @@ def local_read( for c, v in task.writes: if c in select: updated[c].append(v) - if fresh and updated: + if fresh: # apply writes local_channels: dict[str, BaseChannel] = {} for k in channels: - if k in updated: - cc = channels[k].copy() - cc.update(updated[k]) - else: - cc = channels[k] + cc = channels[k].copy() + cc.update(updated[k]) local_channels[k] = cc # read fresh values values = read_channels(local_channels, select)