diff --git a/backend/app/services/copilot_service.py b/backend/app/services/copilot_service.py index b8211e6f..4fc77a5c 100644 --- a/backend/app/services/copilot_service.py +++ b/backend/app/services/copilot_service.py @@ -51,7 +51,15 @@ def _build_flow_context(tree: Tree, current_node_id: Optional[str]) -> str: node = _find_node(tree.tree_structure, current_node_id) if node: parts.append(f"Current node type: {node.get('type', 'unknown')}") - parts.append(f"Current node: {node.get('content', node.get('label', 'Unknown'))}") + node_label = ( + node.get('title') + or node.get('question') + or node.get('description') + or node.get('content') + or node.get('label') + or 'Unknown' + ) + parts.append(f"Current node: {node_label}") # Add options if it's a question/decision node children = node.get("children", []) if children and isinstance(children, list):