From 9495b09e725613f67111d7446912493234717bf9 Mon Sep 17 00:00:00 2001 From: Michael Chihlas Date: Wed, 11 Mar 2026 17:55:26 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20copilot=20node=20context=20=E2=80=94=20u?= =?UTF-8?q?se=20title/question/description=20over=20legacy=20content=20fie?= =?UTF-8?q?ld?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _build_flow_context() was reading node.get('content') which was only present on old KB-imported steps. Now falls back through title → question → description → content → label so all node types (decision, action, solution, procedural step) show correctly in the copilot context. Co-Authored-By: Claude Sonnet 4.6 --- backend/app/services/copilot_service.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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):