diff --git a/libs/langgraph/langgraph/channels/any_value.py b/libs/langgraph/langgraph/channels/any_value.py index 9539ff8a5..51493ab19 100644 --- a/libs/langgraph/langgraph/channels/any_value.py +++ b/libs/langgraph/langgraph/channels/any_value.py @@ -30,7 +30,8 @@ class AnyValue(Generic[Value], BaseChannel[Value, Value, Value]): """The type of the update received by the channel.""" return self.typ - def copy(self): + def copy(self) -> Self: + """Return a copy of the channel.""" empty = self.__class__(self.typ, self.key) empty.value = self.value return empty diff --git a/libs/langgraph/langgraph/channels/binop.py b/libs/langgraph/langgraph/channels/binop.py index b97c4c5fa..1f95d5562 100644 --- a/libs/langgraph/langgraph/channels/binop.py +++ b/libs/langgraph/langgraph/channels/binop.py @@ -66,7 +66,8 @@ class BinaryOperatorAggregate(Generic[Value], BaseChannel[Value, Value, Value]): """The type of the update received by the channel.""" return self.typ - def copy(self): + def copy(self) -> Self: + """Return a copy of the channel.""" empty = self.__class__(self.typ, self.operator) empty.key = self.key empty.value = self.value diff --git a/libs/langgraph/langgraph/pregel/algo.py b/libs/langgraph/langgraph/pregel/algo.py index 3e8a3bded..e43890498 100644 --- a/libs/langgraph/langgraph/pregel/algo.py +++ b/libs/langgraph/langgraph/pregel/algo.py @@ -192,11 +192,11 @@ def local_read( local_channels: dict[str, BaseChannel] = {} for k in channels: if k in updated: - c = channels[k].copy() - c.update(updated[k]) + cc = channels[k].copy() + cc.update(updated[k]) else: - c = channels[k] - local_channels[k] = c + cc = channels[k] + local_channels[k] = cc # read fresh values values = read_channels(local_channels, select) else: