From 1c93267193f37f1f78f7e52b4ca0ac0d6c02a414 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 19 Mar 2026 09:23:47 +0000 Subject: [PATCH] fix: clear P0/P1 alerts after early send to prevent duplicate Matrix messages After sending P0/P1 alerts immediately, reset the variables so they are excluded from the final consolidated ALL_ALERTS send at the end of the script. Co-Authored-By: Claude Sonnet 4.6 --- supervisor/supervisor-poll.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supervisor/supervisor-poll.sh b/supervisor/supervisor-poll.sh index 46a8fa2..522eec0 100755 --- a/supervisor/supervisor-poll.sh +++ b/supervisor/supervisor-poll.sh @@ -145,6 +145,7 @@ fi if [ -n "$P0_ALERTS" ]; then matrix_send "supervisor" "🚨 Supervisor P0 alerts: $(printf '%b' "$P0_ALERTS")" 2>/dev/null || true + P0_ALERTS="" # clear so it is not duplicated in the final consolidated send fi # ============================================================================= @@ -194,6 +195,7 @@ fi if [ -n "$P1_ALERTS" ]; then matrix_send "supervisor" "⚠️ Supervisor P1 alerts: $(printf '%b' "$P1_ALERTS")" 2>/dev/null || true + P1_ALERTS="" # clear so it is not duplicated in the final consolidated send fi # Emit infra metric