diff --git a/atlasbot/engine/answerer.py b/atlasbot/engine/answerer.py index a140651..6db5fd6 100644 --- a/atlasbot/engine/answerer.py +++ b/atlasbot/engine/answerer.py @@ -538,10 +538,21 @@ class AnswerEngine: if io_line: reply = f"From the latest snapshot: {io_line}." if "namespace" in lowered_q and "pod" in lowered_q: + ns_line = None for line in summary_lines: if line.startswith("namespaces_top:"): - reply = f"From the latest snapshot: {line}." + ns_line = line break + cpu_line = None + if any(tok in lowered_q for tok in ("cpu", "hottest", "highest cpu", "highest")): + cpu_facts = _extract_hottest_facts(summary_lines, lowered_q) + cpu_line = next((fact for fact in cpu_facts if fact.startswith("hottest_cpu_node")), None) + if ns_line: + if cpu_line: + reply = f"From the latest snapshot: {cpu_line}; {ns_line}." + else: + reply = f"From the latest snapshot: {ns_line}." + # do not fall through to other overrides if classify.get("question_type") in {"metric", "diagnostic"}: lowered_q = f"{question} {normalized}".lower()