From 774fb2429610de6c37ab3ca2cfb6a61985a9f606 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Mon, 2 Feb 2026 11:23:07 -0300 Subject: [PATCH] atlasbot: extract hottest facts from segment lines --- atlasbot/engine/answerer.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/atlasbot/engine/answerer.py b/atlasbot/engine/answerer.py index 142d125..bfedc80 100644 --- a/atlasbot/engine/answerer.py +++ b/atlasbot/engine/answerer.py @@ -1204,7 +1204,18 @@ def _extract_hottest_facts(lines: list[str], question: str) -> list[str]: return [] if "node" not in lowered and "nodes" not in lowered: return [] - line = next((item for item in lines if item.lower().startswith("hottest:")), "") + line = "" + for item in lines: + if item.lower().startswith("hottest:"): + line = item + break + if " | " in item: + for seg in [seg.strip() for seg in item.split(" | ")]: + if seg.lower().startswith("hottest:"): + line = seg + break + if line: + break if not line: return [] facts = _expand_hottest_line(line) @@ -1291,11 +1302,16 @@ def _metric_candidate_lines(lines: list[str], keywords: list[str] | None, limit: "storagepressure", } candidates: list[str] = [] + expanded: list[str] = [] for line in lines: + if " | " in line: + expanded.extend([seg.strip() for seg in line.split(" | ") if seg.strip()]) + expanded.append(line) + for line in expanded: if line.lower().startswith("hottest:"): candidates.extend(_expand_hottest_line(line)) break - for line in lines: + for line in expanded: line_lower = line.lower() if line_lower.startswith("lexicon_") or line_lower.startswith("units:"): continue