focus: fallback to best keyword line

This commit is contained in:
Brad Stein 2026-02-03 14:49:47 -03:00
parent 702ab87109
commit 1095503454

View File

@ -604,6 +604,10 @@ class AnswerEngine:
model=plan.model,
tag="focus_fix",
)
if not metric_facts:
best_line = _best_keyword_line(summary_lines, keyword_tokens)
if best_line:
reply = f"From the latest snapshot: {best_line}."
if (classify.get("question_type") in {"metric", "diagnostic"} or force_metric) and metric_facts:
best_line = None
lowered_keywords = [kw.lower() for kw in keyword_tokens if kw]