From 92c94b2707208c4d644b58beecea598a6ccda8ce Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Tue, 3 Feb 2026 21:53:02 -0300 Subject: [PATCH] atlasbot: refine follow-up gating --- atlasbot/engine/answerer.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/atlasbot/engine/answerer.py b/atlasbot/engine/answerer.py index 0272908..1ecb0db 100644 --- a/atlasbot/engine/answerer.py +++ b/atlasbot/engine/answerer.py @@ -248,7 +248,8 @@ class AnswerEngine: "pvc", "storage", ) - if any(term in lowered_question for term in cluster_terms): + has_cluster_terms = any(term in lowered_question for term in cluster_terms) + if has_cluster_terms: classify["needs_snapshot"] = True lowered_norm = normalized.lower() if ( @@ -276,8 +277,12 @@ class AnswerEngine: if not classify.get("follow_up") and state and state.claims: follow_terms = ("there", "that", "those", "these", "it", "them", "that one", "this", "former", "latter") - if any(term in lowered_question for term in follow_terms) or len(normalized.split()) <= FOLLOWUP_SHORT_WORDS: - classify["follow_up"] = True + is_metric_query = force_metric or classify.get("question_type") in {"metric", "diagnostic"} + if not is_metric_query: + if any(term in lowered_question for term in follow_terms): + classify["follow_up"] = True + elif len(normalized.split()) <= FOLLOWUP_SHORT_WORDS and not has_cluster_terms: + classify["follow_up"] = True if classify.get("follow_up") and state and state.claims: if observer: