fix(langgraph): align DeltaChannel overwrite semantics#8124
fix(langgraph): align DeltaChannel overwrite semantics#8124Sydney Runkle (sydney-runkle) wants to merge 3 commits into
Conversation
| ) | ||
| remaining = [v for i, v in enumerate(values) if i != overwrite_idx] | ||
| self.value = self.reducer(base, remaining) if remaining else base | ||
| self.value = base |
There was a problem hiding this comment.
🟡 Checkpoint replay keeps discarded writes
This makes live execution treat an overwrite as a hard reset for the whole superstep, but the checkpoint history/replay path still records and replays the other writes from that same superstep. For example, a parallel step that writes Overwrite(["b"]) and ["c"] now returns ["b"] live at that step, but after the next checkpoint reload DeltaChannel.replay_writes() sees both writes and reconstructs ["b", "c"] (and subsequent deltas build on that wrong state). I reproduced this with the new parallel DeltaChannel graph shape: invoke() returned {'messages': ['b', 'd']} while get_state() reconstructed {'messages': ['b', 'c', 'd']}. Please update the replay/history side to drop the same-step deltas that live execution now discards, or otherwise make replay use the same hard-reset semantics.
(Refers to line 180)
Your feedback helps Open SWE learn. React with 👍 or 👎 to tell us if this review comment was useful.
Simplifies
DeltaChannelOverwritehandling by matchingBinaryOperatorAggregate: anOverwritebypasses the reducer for the entire superstep, so same-step writes before or after it are ignored.Alt to https://github.com/langchain-ai/langgraph/pull/7956/changes