hermes-agent/gateway/platforms
StellarisW f57157a128 fix(gateway): recover Discord websocket and event-loop stalls
Replace REST-based Discord liveness probe with local WebSocket/heartbeat
state detection. REST success doesn't prove Gateway event delivery — a
half-closed WebSocket can leave Bot.start() alive while REST returns 200.
Now samples ready/open/ACK state and heartbeat latency; consecutive
unhealthy samples emit one retryable fatal code so GatewayRunner rebuilds
the adapter through the existing reconnect path.

Also fixes three lifecycle gaps in the recovery path:
1. asyncio.wait_for() can remain blocked if adapter cleanup swallows
   cancellation — now uses bounded asyncio.wait() with task detachment.
2. Multiplexed secondary-profile adapters had no profile-scoped reconnect
   owner — now uses one runner-owned reconnect slot per profile.
3. An in-flight turn could send its final text through the disconnected
   adapter after a replacement was registered — now resolves the live
   same-profile replacement for unsent final responses only (message IDs
   never migrate, edits/deletes stay on the old transport).

Adds an opt-in Linux/systemd event-loop watchdog (gateway.systemd_watchdog_seconds,
default 0) for the failure mode where the whole asyncio loop stops making
progress and no in-process liveness task can run. stdlib-only sd_notify,
Type=notify/WatchdogSec generation, READY/STOPPING lifecycle.

Co-authored-by: 王鑫 <wx.xw@bytedance.com>
2026-07-18 20:01:55 +05:30
..
qqbot fix(approval): scope smart deny owner overrides to one operation 2026-07-13 04:31:55 -07:00
__init__.py perf(gateway): defer QQAdapter and YuanbaoAdapter imports via PEP 562 (#22790) 2026-05-09 13:17:48 -07:00
_http_client_limits.py fix(gateway): tighten httpx keepalive and close whatsapp typing-response leak (#18451) 2026-05-02 02:23:37 -07:00
ADDING_A_PLATFORM.md feat(gateway): inline choice pickers for /reasoning and /fast (Telegram, Discord, Matrix) (#65799) 2026-07-16 10:38:31 -07:00
api_server.py fix(gateway): unify reset boundaries vs recovery — promote accidental ends, honor mode=none, adapter-aware resume guidance 2026-07-17 04:51:39 -07:00
base.py fix(gateway): recover Discord websocket and event-loop stalls 2026-07-18 20:01:55 +05:30
bluebubbles.py security(gateway): set explicit client_max_size on 3 uncapped aiohttp servers (#59180) 2026-07-05 14:48:28 -07:00
helpers.py refactor: extract shared GFM table→bullet helpers into helpers.py 2026-06-27 03:57:24 +05:30
msgraph_webhook.py fix(security): widen non-ASCII compare_digest crash fix to all sibling sites 2026-07-16 07:22:24 -07:00
signal.py fix(gateway): validate multiplex adapter config by platform 2026-07-16 05:39:58 -07:00
signal_format.py fix(signal): share markdown formatting across send paths 2026-06-20 13:47:14 +05:30
signal_rate_limit.py feat(gateway/signal): add support for multiple images sending 2026-04-30 04:28:08 -07:00
webhook.py fix(gateway): unify reset boundaries vs recovery — promote accidental ends, honor mode=none, adapter-aware resume guidance 2026-07-17 04:51:39 -07:00
webhook_filters.py feat(gateway): add webhook payload filters 2026-07-08 08:10:55 -07:00
weixin.py fix(gateway/platforms): migrate all Weixin fallbacks to get_secret() for consistent profile-scoped resolution 2026-07-16 05:39:58 -07:00
whatsapp_cloud.py fix(security): widen non-ASCII compare_digest crash fix to all sibling sites 2026-07-16 07:22:24 -07:00
whatsapp_common.py feat(whatsapp): native Baileys polls, clarify-as-poll, locations, and rich inbound metadata 2026-07-05 06:27:20 -07:00
yuanbao.py feat(Yuanbao) optimizes media resource processing speed: parallel download 2026-07-08 08:05:45 -07:00
yuanbao_media.py fix(security): SSRF guard yuanbao media download_url (#54470) 2026-06-28 15:29:59 -07:00
yuanbao_proto.py feat(Yuanbao): support wechat forward msg (#43508) 2026-06-12 02:06:47 -07:00
yuanbao_sticker.py yuanbao platform (#16298) 2026-04-26 18:50:49 -07:00