From 56dfee96717ef0db61667d677810cf483842fee9 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Mon, 23 Dec 2024 15:01:09 +0800 Subject: [PATCH] fix: skip processing for missing source_node_id in node_id_config_mapping Signed-off-by: -LAN- --- .../workflow/nodes/answer/answer_stream_generate_router.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/core/workflow/nodes/answer/answer_stream_generate_router.py b/api/core/workflow/nodes/answer/answer_stream_generate_router.py index 1b948bf59203b7..a30939689141ea 100644 --- a/api/core/workflow/nodes/answer/answer_stream_generate_router.py +++ b/api/core/workflow/nodes/answer/answer_stream_generate_router.py @@ -147,6 +147,9 @@ def _recursive_fetch_answer_dependencies( reverse_edges = reverse_edge_mapping.get(current_node_id, []) for edge in reverse_edges: source_node_id = edge.source_node_id + # found sometimes source_node_id is not in node_id_config_mapping, temporary fix by skip it + if source_node_id not in node_id_config_mapping: + continue source_node_type = node_id_config_mapping[source_node_id].get("data", {}).get("type") source_node_data = node_id_config_mapping[source_node_id].get("data", {}) if (