atlasbot: always include snapshot header
This commit is contained in:
parent
4b8d787650
commit
048459bf66
@ -159,6 +159,19 @@ class AnswerEngine:
|
|||||||
classify.setdefault("needs_snapshot", True)
|
classify.setdefault("needs_snapshot", True)
|
||||||
classify.setdefault("answer_style", "direct")
|
classify.setdefault("answer_style", "direct")
|
||||||
classify.setdefault("follow_up", False)
|
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 classify.get("follow_up") and state and state.claims:
|
||||||
if observer:
|
if observer:
|
||||||
@ -594,7 +607,15 @@ def _select_chunks(
|
|||||||
if not chunks:
|
if not chunks:
|
||||||
return []
|
return []
|
||||||
ranked = sorted(chunks, key=lambda item: scores.get(item["id"], 0.0), reverse=True)
|
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
|
return selected
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user