[PR #4988] Fix fork checkpoint #4188

Closed
opened 2026-02-20 17:49:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/4988

State: closed
Merged: No


What this PR does

  • Updated all code paths that create a new checkpoint during a fork or replay to use is_fork=True when calling create_checkpoint.
  • This ensures that a new, unique checkpoint ID is generated for each new step after a fork, preserving the integrity of the checkpoint history.

Example of the fix:

# Before (buggy)
next_checkpoint = create_checkpoint(checkpoint, None, step)
checkpoint = create_checkpoint(checkpoint, channels, step + 1)

# After (fixed)
next_checkpoint = create_checkpoint(checkpoint, None, step, is_fork=True)
checkpoint = create_checkpoint(checkpoint, channels, step + 1, is_fork=True)

Fixes #4987

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/4988 **State:** closed **Merged:** No --- # What this PR does - Updated all code paths that create a new checkpoint during a fork or replay to use `is_fork=True` when calling `create_checkpoint`. - This ensures that a new, unique checkpoint ID is generated for each new step after a fork, preserving the integrity of the checkpoint history. **Example of the fix:** ```python # Before (buggy) next_checkpoint = create_checkpoint(checkpoint, None, step) checkpoint = create_checkpoint(checkpoint, channels, step + 1) # After (fixed) next_checkpoint = create_checkpoint(checkpoint, None, step, is_fork=True) checkpoint = create_checkpoint(checkpoint, channels, step + 1, is_fork=True) ``` Fixes #4987
yindo added the pull-request label 2026-02-20 17:49:48 -05:00
yindo closed this issue 2026-02-20 17:49:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#4188