From dfbf0ddbcb80ab64a395f10b7104efbda3184484 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Fri, 11 Apr 2025 16:20:45 -0700 Subject: [PATCH] Don't run branch reader in bg thread --- libs/langgraph/langgraph/graph/branch.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/langgraph/langgraph/graph/branch.py b/libs/langgraph/langgraph/graph/branch.py index a1ae358d6..33a2aca1e 100644 --- a/libs/langgraph/langgraph/graph/branch.py +++ b/libs/langgraph/langgraph/graph/branch.py @@ -1,4 +1,3 @@ -import asyncio from inspect import ( isfunction, ismethod, @@ -178,7 +177,7 @@ class Branch(NamedTuple): ], ) -> Runnable: if reader: - value = await asyncio.to_thread(reader, config) + value = reader(config) # passthrough additional keys from node to branch # only doable when using dict states if (