From 6dcff8a839209b82dd9a8bad6707588b06b8d788 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Tue, 17 Jun 2025 13:42:54 -0700 Subject: [PATCH] If FuturesDict callback has been GCed, don't call it --- libs/checkpoint-postgres/uv.lock | 2 +- libs/checkpoint-sqlite/uv.lock | 2 +- libs/langgraph/langgraph/pregel/runner.py | 3 ++- libs/prebuilt/uv.lock | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/checkpoint-postgres/uv.lock b/libs/checkpoint-postgres/uv.lock index d258577b8..45161991d 100644 --- a/libs/checkpoint-postgres/uv.lock +++ b/libs/checkpoint-postgres/uv.lock @@ -308,7 +308,7 @@ wheels = [ [[package]] name = "langgraph-checkpoint" -version = "2.0.26" +version = "2.1.0" source = { editable = "../checkpoint" } dependencies = [ { name = "langchain-core" }, diff --git a/libs/checkpoint-sqlite/uv.lock b/libs/checkpoint-sqlite/uv.lock index ab6817b6f..f2d58d81f 100644 --- a/libs/checkpoint-sqlite/uv.lock +++ b/libs/checkpoint-sqlite/uv.lock @@ -320,7 +320,7 @@ wheels = [ [[package]] name = "langgraph-checkpoint" -version = "2.0.26" +version = "2.1.0" source = { editable = "../checkpoint" } dependencies = [ { name = "langchain-core" }, diff --git a/libs/langgraph/langgraph/pregel/runner.py b/libs/langgraph/langgraph/pregel/runner.py index 47afc199d..ab6c7a17d 100644 --- a/libs/langgraph/langgraph/pregel/runner.py +++ b/libs/langgraph/langgraph/pregel/runner.py @@ -104,7 +104,8 @@ class FuturesDict(Generic[F, E], dict[F, Optional[PregelExecutableTask]]): fut: F, ) -> None: try: - self.callback()(task, _exception(fut)) # type: ignore[misc] + if cb := self.callback(): + cb(task, _exception(fut)) finally: with self.lock: self.done.add(fut) diff --git a/libs/prebuilt/uv.lock b/libs/prebuilt/uv.lock index 5fde75d82..081b09537 100644 --- a/libs/prebuilt/uv.lock +++ b/libs/prebuilt/uv.lock @@ -320,7 +320,7 @@ wheels = [ [[package]] name = "langgraph" -version = "0.5.0rc0" +version = "0.5.0rc1" source = { editable = "../langgraph" } dependencies = [ { name = "langchain-core" },