From b6e8c01e99171d09dae7af3d719c2803ae20e257 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Mon, 26 Jan 2026 19:01:26 -0300 Subject: [PATCH] atlasbot: improve missing node inference --- services/comms/scripts/atlasbot/bot.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/services/comms/scripts/atlasbot/bot.py b/services/comms/scripts/atlasbot/bot.py index bd40a9f..7eb6dc7 100644 --- a/services/comms/scripts/atlasbot/bot.py +++ b/services/comms/scripts/atlasbot/bot.py @@ -754,6 +754,15 @@ def expected_worker_nodes_from_metrics() -> list[str]: return [] def missing_nodes_answer(cluster_name: str) -> str: + expected_workers = expected_worker_nodes_from_metrics() + if expected_workers: + ready_nodes, not_ready_nodes = worker_nodes_status() + current_workers = set(ready_nodes + not_ready_nodes) + missing = sorted(set(expected_workers) - current_workers) + if not missing: + return f"{cluster_name}: no missing worker nodes versus Grafana inventory." + return f"{cluster_name} missing worker nodes versus Grafana inventory: {', '.join(missing)}." + expected = expected_nodes_from_kb() if not expected: return "" @@ -1173,7 +1182,7 @@ def sync_loop(token: str, room_id: str): continue send_msg(token, rid, summary) continue - if re.search(r"\bnode names?\b|\bnodes? named\b|\bnaming\b", lower_body): + if re.search(r"\bnode names?\b|\bnodes?\b.*\bnamed\b|\bnaming\b", lower_body): if any(word in lower_body for word in ("cluster", "atlas", "titan")): names_summary = nodes_names_summary("Atlas") if not names_summary: @@ -1181,6 +1190,14 @@ def sync_loop(token: str, room_id: str): continue send_msg(token, rid, names_summary) continue + if re.search(r"\bwhich nodes are ready\b|\bnodes ready\b", lower_body): + ready_nodes, not_ready_nodes = worker_nodes_status() + if ready_nodes: + msg = f"Ready worker nodes ({len(ready_nodes)}): {', '.join(ready_nodes)}." + if not_ready_nodes: + msg += f" Not Ready: {', '.join(not_ready_nodes)}." + send_msg(token, rid, msg) + continue # Only do live cluster introspection in DMs; metrics can be answered when mentioned. allow_tools = is_dm