From 85d48ce3c9d4c81f7fc4f3f5beed4f91b10d3d66 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 15 Jun 2026 23:01:15 +0000 Subject: [PATCH] fix(fire): remove immediate-severity exemption from grouper + cooldown Fire events carried _severity_override="immediate" which zeroed the dispatcher cooldown and skipped the Grouper coalescer. This meant fire had no rate control in normal live operation. Drain-mode pacer handles reconnect bursts; this change closes the live-operation gap so fire obeys the toggle cooldown_seconds like every other family. Co-Authored-By: Claude Opus 4.6 --- meshai/notifications/pipeline/dispatcher.py | 11 +++++------ meshai/notifications/pipeline/grouper.py | 6 ------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/meshai/notifications/pipeline/dispatcher.py b/meshai/notifications/pipeline/dispatcher.py index fa3b734..b93d7b3 100644 --- a/meshai/notifications/pipeline/dispatcher.py +++ b/meshai/notifications/pipeline/dispatcher.py @@ -379,15 +379,14 @@ class Dispatcher: return # ---------- Section 3 — per-toggle cooldown (check only) ---------- - # Immediate-severity events bypass cooldown entirely — they are - # already rate-controlled by source handler change detection. + # All severities (including immediate) obey cooldown. Fire rate + # control was previously bypassed for immediate; the drain-mode + # pacer handles reconnect bursts, and this cooldown handles + # normal live operation (≤1 per cooldown window per toggle/key). # v0.6-4 (B13 fix): this section only CHECKS the cooldown. Arming # it is deferred to Section 6 and happens only after a delivery # actually succeeded. - if getattr(event, "severity", None) == "immediate": - cooldown_s = 0 - else: - cooldown_s = int(getattr(tog, "cooldown_seconds", 300) or 0) + cooldown_s = int(getattr(tog, "cooldown_seconds", 300) or 0) ck = None if cooldown_s > 0: suffix = (event.data or {}).get("_cooldown_suffix", "") diff --git a/meshai/notifications/pipeline/grouper.py b/meshai/notifications/pipeline/grouper.py index 082bec5..ce42a12 100644 --- a/meshai/notifications/pipeline/grouper.py +++ b/meshai/notifications/pipeline/grouper.py @@ -100,12 +100,6 @@ class Grouper: event with the same group_key. The held event is emitted later via tick(). """ - # Immediate-severity events bypass the coalescing window entirely - # (Phase 2.16.1): they must be delivered without buffering latency. - if event.severity == "immediate": - self._next(event) - return - if not event.group_key: self._next(event) return