atlasbot: preserve hotspot reply for namespace
This commit is contained in:
parent
61d9ebd707
commit
23b31a2a38
@ -279,6 +279,7 @@ class AnswerEngine:
|
||||
if "node" in lowered_q:
|
||||
focus_entity = "node"
|
||||
|
||||
hotspot_override = False
|
||||
snapshot_context = ""
|
||||
if classify.get("needs_snapshot"):
|
||||
if observer:
|
||||
@ -305,6 +306,7 @@ class AnswerEngine:
|
||||
break
|
||||
metric_facts = [line for line in key_facts if re.search(r"\d", line)]
|
||||
hotspot_request = any(term in lowered_q for term in ("hot spot", "hotspot", "hot spots", "hotspots"))
|
||||
hotspot_override = False
|
||||
if focus_entity == "node" and hottest_facts:
|
||||
metric_facts = hottest_facts
|
||||
key_facts = _merge_fact_lines(metric_facts, key_facts)
|
||||
@ -612,8 +614,9 @@ class AnswerEngine:
|
||||
reply = f"Current hotspots: {hotspot_line}. {namespace_line}."
|
||||
else:
|
||||
reply = f"Current hotspots: {hotspot_line}."
|
||||
hotspot_override = True
|
||||
|
||||
if classify.get("question_type") in {"metric", "diagnostic"} and metric_facts:
|
||||
if classify.get("question_type") in {"metric", "diagnostic"} and metric_facts and not hotspot_override:
|
||||
reply = _metric_fact_guard(reply, metric_facts, keyword_tokens)
|
||||
|
||||
if classify.get("question_type") in {"metric", "diagnostic"}:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user