chore: more back pressure#7499
Draft
William FH (hinthornw) wants to merge 4 commits into
Draft
Conversation
Sydney Runkle (sydney-runkle)
left a comment
Collaborator
There was a problem hiding this comment.
some questions / comments
Comment on lines
+903
to
+904
| def _put_checkpoint(self, metadata: CheckpointMetadata) -> None: | ||
| raise NotImplementedError |
Collaborator
There was a problem hiding this comment.
are we worried this will break for folks?
Comment on lines
+959
to
+963
| if self.durability == "exit" and ( | ||
| not self.is_nested | ||
| or exc_value is not None | ||
| or all(NS_END not in part for part in self.checkpoint_ns) | ||
| ): |
Collaborator
There was a problem hiding this comment.
can we add the comments bacK?
| self._dispatch_checkpoint_request(request) | ||
|
|
||
| def after_tick(self) -> None: | ||
| if request := self._after_tick(): |
Collaborator
There was a problem hiding this comment.
this pattern feels confusing to me
Comment on lines
+1393
to
+1399
| if self.durability == "exit" and ( | ||
| not self.is_nested | ||
| or exc_value is not None | ||
| or all(NS_END not in part for part in self.checkpoint_ns) | ||
| ): | ||
| if request := self._prepare_checkpoint(self.checkpoint_metadata): | ||
| await self._dispatch_checkpoint_request(request) |
Collaborator
There was a problem hiding this comment.
bug that we didn't have this before?
Christian Bromann (christian-bromann)
added a commit
to langchain-ai/langgraphjs
that referenced
this pull request
Jun 10, 2026
## Summary Ports Python time-travel fixes ([#7038](langchain-ai/langgraph#7038), [#7115](langchain-ai/langgraph#7115), [#7498](langchain-ai/langgraph#7498), [#7499](langchain-ai/langgraph#7499)) into `@langchain/langgraph` so replay/fork behave correctly with interrupts and nested subgraphs. - **Stale `RESUME` on replay** — Replaying from a checkpoint before an interrupt no longer consumes cached resume writes; interrupts re-fire with the correct payload. - **Subgraph checkpoint loading on time travel** — Introduces `ReplayState` (`CONFIG_KEY_REPLAY_STATE`) so nested subgraphs load the checkpoint that existed at the replay point on first visit, then resume normal head loading within the same run. - **Parent fork checkpoints on replay** — Time travel runs through `PregelLoop._first()` (not `stream()` delegation on the parent `Pregel`), creating an eager `source: "fork"` checkpoint and propagating `ReplayState` to subgraphs. - **Direct-to-subgraph time travel** — `getState()` subgraph delegation is guarded with `CONFIG_KEY_READ`; direct subgraph configs strip stale `RESUME` writes and prefer explicit `checkpoint_id` over `checkpoint_map` when both are set. - **Streaming** — Fixes subgraph interrupt namespace when streaming with `subgraphs: true` (empty `checkpoint_ns` no longer becomes `[""]`; parent emits interrupts under the deepest `checkpoint_map` namespace). Closes #2325 (supersedes the earlier partial port). ### Implementation notes | Area | Change | |------|--------| | `pregel/replay.ts` | New `ReplayState` class (mirrors Python) | | `pregel/loop.ts` | Replay/time-travel detection, fork creation, `RESUME` stripping, `ReplayState` wiring, stream namespace helpers | | `pregel/index.ts` | `getState` subgraph delegation guard only (removed `stream()` bypass that skipped parent fork creation) | | Tests | `time_travel.test.ts` (14), `time_travel_extended.test.ts` (33), shared `time_travel_helpers.ts`, Vitest matchers `toBeInterrupted` / `toHaveInterruptValue` | --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#7094