From efdd54a670a6637791fe1fb93a051e3451d17d61 Mon Sep 17 00:00:00 2001 From: yihong Date: Thu, 26 Dec 2024 10:31:05 +0800 Subject: [PATCH] fix: issue #12068 by test is answer in the ids (#12105) Signed-off-by: yihong0618 --- api/core/workflow/nodes/answer/base_stream_processor.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/core/workflow/nodes/answer/base_stream_processor.py b/api/core/workflow/nodes/answer/base_stream_processor.py index 8ffb487ec108f8..f22ea078fb87eb 100644 --- a/api/core/workflow/nodes/answer/base_stream_processor.py +++ b/api/core/workflow/nodes/answer/base_stream_processor.py @@ -48,9 +48,11 @@ def _remove_unreachable_nodes(self, event: NodeRunSucceededEvent | NodeRunExcept # we remove the node maybe shortcut the answer node, so comment this code for now # there is not effect on the answer node and the workflow, when we have a better solution # we can open this code. Issues: #11542 #9560 #10638 #10564 - - # reachable_node_ids.extend(self._fetch_node_ids_in_reachable_branch(edge.target_node_id)) - continue + ids = self._fetch_node_ids_in_reachable_branch(edge.target_node_id) + if "answer" in ids: + continue + else: + reachable_node_ids.extend(ids) else: unreachable_first_node_ids.append(edge.target_node_id)