diff --git a/libs/checkpoint/langgraph/checkpoint/base/__init__.py b/libs/checkpoint/langgraph/checkpoint/base/__init__.py index a3ad83b1a..6805ada0e 100644 --- a/libs/checkpoint/langgraph/checkpoint/base/__init__.py +++ b/libs/checkpoint/langgraph/checkpoint/base/__init__.py @@ -39,12 +39,13 @@ PendingWrite = Tuple[str, str, Any] class CheckpointMetadata(TypedDict, total=False): """Metadata associated with a checkpoint.""" - source: Literal["input", "loop", "update"] + source: Literal["input", "loop", "update", "fork"] """The source of the checkpoint. - "input": The checkpoint was created from an input to invoke/stream/batch. - "loop": The checkpoint was created from inside the pregel loop. - "update": The checkpoint was created from a manual state update. + - "fork": The checkpoint was created as a copy of another checkpoint. """ step: int """The step number of the checkpoint. diff --git a/libs/langgraph/langgraph/pregel/__init__.py b/libs/langgraph/langgraph/pregel/__init__.py index f49a2207a..b6bfa895a 100644 --- a/libs/langgraph/langgraph/pregel/__init__.py +++ b/libs/langgraph/langgraph/pregel/__init__.py @@ -946,7 +946,7 @@ class Pregel(PregelProtocol): create_checkpoint(checkpoint, None, step), { **checkpoint_metadata, - "source": "update", + "source": "fork", "step": step + 1, "writes": {}, "parents": saved.metadata.get("parents", {}) if saved else {}, @@ -965,7 +965,7 @@ class Pregel(PregelProtocol): next_checkpoint, { **checkpoint_metadata, - "source": "update", + "source": "fork", "step": step + 1, "writes": {}, "parents": saved.metadata.get("parents", {}) if saved else {},