diff --git a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py index 215c84206..25d823c86 100644 --- a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py +++ b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py @@ -510,6 +510,8 @@ def get_next_version(self, current: Optional[str], channel: ChannelProtocol) -> """ if current is None: current_v = 0 + elif isinstance(current, int): + current_v = current else: current_v = int(current.split(".")[0]) next_v = current_v + 1 diff --git a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py index 0e3ab0ecb..73bc3ef02 100644 --- a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py +++ b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py @@ -515,6 +515,8 @@ def get_next_version(self, current: Optional[str], channel: ChannelProtocol) -> """ if current is None: current_v = 0 + elif isinstance(current, int): + current_v = current else: current_v = int(current.split(".")[0]) next_v = current_v + 1