From 67d907eb1c482a63ed46d139967a88e7d382a44b Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 25 Sep 2024 10:38:06 -0700 Subject: [PATCH] Fix stream_mode=messages/custom buffering for sync calls with single node --- libs/langgraph/langgraph/pregel/runner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/langgraph/langgraph/pregel/runner.py b/libs/langgraph/langgraph/pregel/runner.py index b8392b613..b7ad68884 100644 --- a/libs/langgraph/langgraph/pregel/runner.py +++ b/libs/langgraph/langgraph/pregel/runner.py @@ -49,8 +49,8 @@ class PregelRunner: tasks = tuple(tasks) # give control back to the caller yield - # fast path if single task with no timeout - if len(tasks) == 1 and timeout is None: + # fast path if single task with no timeout and no waiter + if len(tasks) == 1 and timeout is None and get_waiter is None: t = tasks[0] try: run_with_retry(t, retry_policy)