diff --git a/libs/langgraph/langgraph/pregel/algo.py b/libs/langgraph/langgraph/pregel/algo.py index 5be5e2311..c2d17d604 100644 --- a/libs/langgraph/langgraph/pregel/algo.py +++ b/libs/langgraph/langgraph/pregel/algo.py @@ -1,6 +1,5 @@ import sys from collections import defaultdict, deque -from contextvars import Context from functools import partial from hashlib import sha1 from typing import ( @@ -122,7 +121,7 @@ class Call: input: Any, *, retry: Optional[RetryPolicy], - callbacks: Optional[Context], + callbacks: Optional[Callbacks], ) -> None: self.func = func self.input = input diff --git a/libs/langgraph/langgraph/pregel/executor.py b/libs/langgraph/langgraph/pregel/executor.py index 7e64a244a..80ce20e7c 100644 --- a/libs/langgraph/langgraph/pregel/executor.py +++ b/libs/langgraph/langgraph/pregel/executor.py @@ -65,7 +65,10 @@ class BackgroundExecutor(ContextManager): ) -> concurrent.futures.Future[T]: ctx = copy_context() if __next_tick__: - task = self.executor.submit(next_tick, ctx.run, fn, *args, **kwargs) + task = cast( + concurrent.futures.Future[T], + self.executor.submit(next_tick, ctx.run, fn, *args, **kwargs), # type: ignore[arg-type] + ) else: task = self.executor.submit(ctx.run, fn, *args, **kwargs) self.tasks[task] = (__cancel_on_exit__, __reraise_on_exit__) diff --git a/libs/langgraph/langgraph/types.py b/libs/langgraph/langgraph/types.py index aa328bbb8..c0bd066ca 100644 --- a/libs/langgraph/langgraph/types.py +++ b/libs/langgraph/langgraph/types.py @@ -443,7 +443,6 @@ def interrupt(value: Any) -> Any: GraphInterrupt: On the first invocation within the node, halts execution and surfaces the provided value to the client. """ from langgraph.constants import ( - CONF, CONFIG_KEY_CHECKPOINT_NS, CONFIG_KEY_SCRATCHPAD, CONFIG_KEY_SEND, @@ -456,7 +455,7 @@ def interrupt(value: Any) -> Any: from langgraph.errors import GraphInterrupt from langgraph.utils.config import get_config - conf = get_config()[CONF] + conf = get_config()["configurable"] # track interrupt index scratchpad: PregelScratchpad = conf[CONFIG_KEY_SCRATCHPAD] if "interrupt_counter" not in scratchpad: