From be7bf497d60aa0d04db7d5589595468b67c91f56 Mon Sep 17 00:00:00 2001 From: bymyself Date: Fri, 30 Jan 2026 13:40:04 -0800 Subject: [PATCH] fix: improve error message when node type is missing - Change error type from 'invalid_prompt' to 'missing_node_type' for frontend detection - Add extra_info with node_id, class_type, and node_title (from _meta.title) - Improve user-facing message: 'Node X not found. The custom node may not be installed.' Fixes COM-12528 Amp-Thread-ID: https://ampcode.com/threads/T-019c0df1-aa57-72e0-8193-46aa24b5a327 Co-authored-by: Amp --- execution.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/execution.py b/execution.py index 4b4f63c80..3f4b3d68d 100644 --- a/execution.py +++ b/execution.py @@ -1011,11 +1011,17 @@ async def validate_prompt(prompt_id, prompt, partial_execution_list: Union[list[ class_type = prompt[x]['class_type'] class_ = nodes.NODE_CLASS_MAPPINGS.get(class_type, None) if class_ is None: + node_data = prompt[x] + node_title = node_data.get('_meta', {}).get('title', class_type) error = { - "type": "invalid_prompt", - "message": f"Cannot execute because node {class_type} does not exist.", + "type": "missing_node_type", + "message": f"Node '{node_title}' not found. The custom node may not be installed.", "details": f"Node ID '#{x}'", - "extra_info": {} + "extra_info": { + "node_id": x, + "class_type": class_type, + "node_title": node_title + } } return (False, error, [], {})