From 533796a8336a64f7ea2c2c9c239f9efe7ada0aa0 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Tue, 22 Sep 2026 12:26:53 +0530 Subject: [PATCH] refactor(discord): trim the first-strike comment to its WHY The six-line comment above the terminal-reason check (plugins/platforms/discord/adapter.py:1789-1794) restated the resume-swap mechanism already documented in the test docstring and the issue. Keep the one sentence that carries the intent (closed transport = confirmed death, soft signals keep the threshold) and the #118487 pointer. No code change. --- plugins/platforms/discord/adapter.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/platforms/discord/adapter.py b/plugins/platforms/discord/adapter.py index dd503b5104..f5de391ec8 100644 --- a/plugins/platforms/discord/adapter.py +++ b/plugins/platforms/discord/adapter.py @@ -1786,12 +1786,8 @@ class DiscordAdapter(DiscordMediaMixin, BasePlatformAdapter): "[%s] Discord Gateway WebSocket unhealthy (%s, %d/%d)", self.name, reason, failures, threshold, ) - # A closed transport (``socket_closed``) is a confirmed death, not a suspicion: - # the resume path replaces the socket, the next sample reads healthy, and this - # counter silently resets — while a resumed-but-deaf session stays event-starved - # until the multi-hour event-silence default elapses (#118487). Escalate the - # first ``socket_closed`` / ``client_closed`` strike (both mean the transport is - # gone); soft signals (ack staleness, latency, silence) keep the threshold. + # A closed transport is a confirmed death, not a suspicion: escalate on the + # first strike; soft signals keep the threshold (#118487). terminal = reason in ("socket_closed", "client_closed") if failures < threshold and not terminal: continue