diff --git a/libs/langgraph/langgraph/pregel/loop.py b/libs/langgraph/langgraph/pregel/loop.py index 537929aa4..4dccb6429 100644 --- a/libs/langgraph/langgraph/pregel/loop.py +++ b/libs/langgraph/langgraph/pregel/loop.py @@ -341,8 +341,10 @@ class PregelLoop: k: v for k, v in channel_versions.items() if k not in self.checkpoint_previous_versions - or k in self.checkpoint_previous_versions - and v > self.checkpoint_previous_versions[k] + or ( + k in self.checkpoint_previous_versions + and v > self.checkpoint_previous_versions[k] + ) } else: new_versions = channel_versions diff --git a/libs/langgraph/tests/test_pregel.py b/libs/langgraph/tests/test_pregel.py index e025efac0..55e6ad976 100644 --- a/libs/langgraph/tests/test_pregel.py +++ b/libs/langgraph/tests/test_pregel.py @@ -7452,12 +7452,20 @@ def test_simple_multi_edge(snapshot: SnapshotAssertion) -> None: assert app.get_graph().draw_mermaid(with_styles=False) == snapshot assert app.invoke({"my_key": "my_value"}) == {"my_key": "my_value_more"} - assert [*app.stream({"my_key": "my_value"})] == [ - {"up": None}, - {"side": None}, - {"other": {"my_key": "_more"}}, - {"down": None}, - ] + assert [*app.stream({"my_key": "my_value"})] in ( + [ + {"up": None}, + {"side": None}, + {"other": {"my_key": "_more"}}, + {"down": None}, + ], + [ + {"up": None}, + {"other": {"my_key": "_more"}}, + {"side": None}, + {"down": None}, + ], + ) def test_nested_graph_xray(snapshot: SnapshotAssertion) -> None: diff --git a/libs/sdk-js/src/schema.ts b/libs/sdk-js/src/schema.ts index 69cb069f7..897ed1ed8 100644 --- a/libs/sdk-js/src/schema.ts +++ b/libs/sdk-js/src/schema.ts @@ -27,7 +27,7 @@ export interface Config { /** * Timestamp of the state checkpoint */ - thread_ts?: string; + checkpoint_id?: string; [key: string]: unknown; }; } diff --git a/libs/sdk-py/langgraph_sdk/client.py b/libs/sdk-py/langgraph_sdk/client.py index b6affc2b3..13d5560db 100644 --- a/libs/sdk-py/langgraph_sdk/client.py +++ b/libs/sdk-py/langgraph_sdk/client.py @@ -783,7 +783,8 @@ class ThreadsClient: 'configurable': { 'thread_id': 'e2496803-ecd5-4e0c-a779-3226296181c2', - 'thread_ts': '1ef4a9b8-e6fb-67b1-8001-abd5184439d1' + 'checkpoint_ns': '', + 'checkpoint_id': '1ef4a9b8-e6fb-67b1-8001-abd5184439d1' } }, 'metadata': @@ -822,7 +823,8 @@ class ThreadsClient: 'configurable': { 'thread_id': 'e2496803-ecd5-4e0c-a779-3226296181c2', - 'thread_ts': '1ef4a9b8-d80d-6fa7-8000-9300467fad0f' + 'checkpoint_ns': '', + 'checkpoint_id': '1ef4a9b8-d80d-6fa7-8000-9300467fad0f' } } } @@ -1184,7 +1186,7 @@ class RunsClient: 'user_id': None, 'graph_id': 'agent', 'thread_id': 'my_thread_id', - 'thread_ts': None, + 'checkpoint_id': None, 'model_name': "openai", 'assistant_id': 'my_assistant_id' }