From e77fd75c442cc3ec6cfbc91964a6dfe2dc3f777d Mon Sep 17 00:00:00 2001 From: 02356abc <198679067+02356abc@users.noreply.github.com> Date: Tue, 12 May 2026 18:48:10 -0700 Subject: [PATCH] fix(wecom): update connection status after WebSocket reconnection The WeCom adapter's _listen_loop() automatically reconnects when the WebSocket drops, but it never called _mark_connected() after a successful reconnection. This left the runtime status file (gateway_state.json) stuck in "disconnected" even though the adapter was fully operational again. Add self._mark_connected() right after _open_connection() succeeds so that the dashboard and health probes report the correct state. Tested by forcing a WebSocket close via the heartbeat loop and verifying that the status file updated from "disconnected" back to "connected". --- gateway/platforms/wecom.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gateway/platforms/wecom.py b/gateway/platforms/wecom.py index d7a5c1d9a49..96769ea59b1 100644 --- a/gateway/platforms/wecom.py +++ b/gateway/platforms/wecom.py @@ -345,6 +345,7 @@ class WeComAdapter(BasePlatformAdapter): try: await self._open_connection() backoff_idx = 0 + self._mark_connected() logger.info("[%s] Reconnected", self.name) except Exception as reconnect_exc: logger.warning("[%s] Reconnect failed: %s", self.name, reconnect_exc)