From bf5e7b343a1cfbb797bb95024ec264f94613ca32 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 4 Jul 2024 09:25:16 -0300 Subject: [PATCH] fix(base.py): only add successors if is_start (#2513) --- src/backend/base/langflow/graph/graph/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/base/langflow/graph/graph/base.py b/src/backend/base/langflow/graph/graph/base.py index a83a971b5..cd761bbff 100644 --- a/src/backend/base/langflow/graph/graph/base.py +++ b/src/backend/base/langflow/graph/graph/base.py @@ -1236,9 +1236,11 @@ class Graph: stack.append(successor.id) else: excluded.add(successor.id) - elif current_id not in stop_predecessors: + elif current_id not in stop_predecessors and is_start: # If the current vertex is not the target vertex, we should add all its successors # to the stack if they are not in visited + + # If we are starting from the beginning, we should add all successors for successor in current_vertex.successors: if successor.id not in visited: stack.append(successor.id)