atlasbot: always include snapshot header

This commit is contained in:
Brad Stein 2026-01-31 14:19:47 -03:00
parent 4b8d787650
commit 048459bf66

View File

@ -159,6 +159,19 @@ class AnswerEngine:
classify.setdefault("needs_snapshot", True)
classify.setdefault("answer_style", "direct")
classify.setdefault("follow_up", False)
cluster_terms = (
"atlas",
"cluster",
"node",
"nodes",
"namespace",
"pod",
"workload",
"k8s",
"kubernetes",
)
if any(term in normalized.lower() for term in cluster_terms):
classify["needs_snapshot"] = True
if classify.get("follow_up") and state and state.claims:
if observer:
@ -594,7 +607,15 @@ def _select_chunks(
if not chunks:
return []
ranked = sorted(chunks, key=lambda item: scores.get(item["id"], 0.0), reverse=True)
selected = ranked[: plan.chunk_top]
selected: list[dict[str, Any]] = []
head = chunks[0]
selected.append(head)
for item in ranked:
if len(selected) >= plan.chunk_top:
break
if item is head:
continue
selected.append(item)
return selected