From 4c3a38d324df6a76a41f1e97b66e20885099cf74 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 18 Dec 2024 13:15:38 +0000 Subject: [PATCH 1/2] lib: Fix incorrect default for Command.update - this should not default to empty tuple, it should default to None --- libs/langgraph/langgraph/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langgraph/langgraph/types.py b/libs/langgraph/langgraph/types.py index 7dc3aeec2..6b90f8acd 100644 --- a/libs/langgraph/langgraph/types.py +++ b/libs/langgraph/langgraph/types.py @@ -271,7 +271,7 @@ class Command(Generic[N], ToolOutputMixin): """ graph: Optional[str] = None - update: Any = () + update: Optional[Any] = None resume: Optional[Union[Any, dict[str, Any]]] = None goto: Union[Send, Sequence[Union[Send, str]], str] = () From 39281c866def602adfe43b9f8fa937ddfcfee42d Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 18 Dec 2024 13:28:22 +0000 Subject: [PATCH 2/2] Fix --- libs/langgraph/langgraph/types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/langgraph/langgraph/types.py b/libs/langgraph/langgraph/types.py index 6b90f8acd..53dc6bd57 100644 --- a/libs/langgraph/langgraph/types.py +++ b/libs/langgraph/langgraph/types.py @@ -292,8 +292,10 @@ def _update_as_tuples(self) -> Sequence[tuple[str, Any]]: for t in self.update ): return self.update - else: + elif self.update is not None: return [("__root__", self.update)] + else: + return [] PARENT: ClassVar[Literal["__parent__"]] = "__parent__"