diff --git a/libs/langgraph/langgraph/pregel/executor.py b/libs/langgraph/langgraph/pregel/executor.py index 2b627df2e..246510fb4 100644 --- a/libs/langgraph/langgraph/pregel/executor.py +++ b/libs/langgraph/langgraph/pregel/executor.py @@ -124,7 +124,9 @@ class AsyncBackgroundExecutor(AsyncContextManager): self.sentinel = object() self.loop = asyncio.get_running_loop() if max_concurrency := config.get("max_concurrency"): - self.semaphore = asyncio.Semaphore(max_concurrency) + self.semaphore: Optional[asyncio.Semaphore] = asyncio.Semaphore( + max_concurrency + ) else: self.semaphore = None