From c5dad0d68a3ac3d3776476e9346e42283433e4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Wed, 6 May 2026 15:41:29 +0800 Subject: [PATCH] fix: Fix `intent-node` execution details not displaying `user input` --- apps/application/flow/common.py | 12 +++++++----- apps/application/flow/compare/__init__.py | 10 ++++++---- ui/src/components/execution-detail-card/index.vue | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/apps/application/flow/common.py b/apps/application/flow/common.py index d7520cf690c..c3af9a3e2c6 100644 --- a/apps/application/flow/common.py +++ b/apps/application/flow/common.py @@ -19,9 +19,11 @@ from models_provider.tools import get_model_credential from tools.models.tool import Tool -end_nodes = ['ai-chat-node', 'reply-node', 'function-node', 'function-lib-node', 'application-node', - 'image-understand-node', 'speech-to-text-node', 'text-to-speech-node', 'image-generate-node', - 'variable-assign-node'] +END_NODES = frozenset([ + 'ai-chat-node', 'reply-node', 'function-node', 'function-lib-node', 'application-node', + 'image-understand-node', 'speech-to-text-node', 'text-to-speech-node', 'image-generate-node', + 'variable-assign-node' +]) class Answer: @@ -219,14 +221,14 @@ def is_valid_node(self, node: Node): for branch in branch_list: source_anchor_id = f"{node.id}_{branch.get('id')}_right" edge_list = [edge for edge in self.edges if edge.sourceAnchorId == source_anchor_id] - if len(edge_list) == 0: + if not edge_list: raise AppApiException(500, _('The branch {branch} of the {node} node needs to be connected').format( node=node.properties.get("stepName"), branch=branch.get("type"))) else: edge_list = [edge for edge in self.edges if edge.sourceNodeId == node.id] - if len(edge_list) == 0 and not end_nodes.__contains__(node.type): + if not edge_list and node.type not in END_NODES: raise AppApiException(500, _("{node} Nodes cannot be considered as end nodes").format( node=node.properties.get("stepName"))) diff --git a/apps/application/flow/compare/__init__.py b/apps/application/flow/compare/__init__.py index ce0c430e1ad..a6c3309eb82 100644 --- a/apps/application/flow/compare/__init__.py +++ b/apps/application/flow/compare/__init__.py @@ -30,6 +30,8 @@ from .start_with import StartWithCompare from .wildcard_compare import WildcardCompare +from common.utils.logger import maxkb_logger + _compare_handler_dict = { 'is_null': IsNullCompare(), 'is_not_null': IsNotNullCompare(), @@ -65,13 +67,13 @@ def _compare(source_value, compare, target_value): def _assertion(workflow_manage, field_list: List[str], compare: str, value): try: value = workflow_manage.generate_prompt(value) - except Exception: - pass + except Exception as e: + maxkb_logger.debug(f"Failed to generate field value for comparison: {e}") field_value = None try: field_value = workflow_manage.get_reference_field(field_list[0], field_list[1:]) - except Exception: - pass + except Exception as e: + maxkb_logger.debug(f"Failed to get reference field for comparison: {e}") return _compare(field_value, compare, value) diff --git a/ui/src/components/execution-detail-card/index.vue b/ui/src/components/execution-detail-card/index.vue index c005b4dbb69..f218014e984 100644 --- a/ui/src/components/execution-detail-card/index.vue +++ b/ui/src/components/execution-detail-card/index.vue @@ -312,7 +312,7 @@ {{ $t('aiChat.executionDetails.currentChat') }}