hermes-agent/plugins/platforms
Jaret Bottoms e16743b0d5 fix(telegram): diagnose blocked-loop init hangs, unbind DoH from system DNS
The #63309 hang class — gateway stuck at 'Connecting to Telegram
(attempt 1/8)' with no retry, no timeout, for minutes — can only occur
when the event loop thread itself is blocked in a synchronous call:
_await_with_thread_deadline's timer fires off-loop, but its expiry
hand-off (call_soon_threadsafe) still needs the loop to run, and the
gateway's outer wait_for is a pure loop timer. When the loop is pinned,
every layer goes silent simultaneously and the process wedges with no
evidence of where.

Two changes:

1. Loop-blocked watchdog in _await_with_thread_deadline: a second
   daemon timer fires one grace period (5s) after the deadline; if the
   loop still hasn't processed the expiry, it logs a WARNING from the
   timer thread and faulthandler-dumps all thread stacks to stderr —
   converting the silent hang into a trace that names the exact
   blocking frame. A threading.Event set by the expiry callback (and on
   normal exit) keeps completed awaits from ever being misreported.

2. discover_fallback_ips: the system-resolver leg runs
   socket.getaddrinfo in a worker thread with no timeout, and
   asyncio.gather waited on it unboundedly — a wedged OS resolver
   stalled discovery for minutes between the two startup log lines. Its
   result only feeds a log message, so it no longer gates discovery:
   DoH legs (already client-bounded) are gathered alone and the system
   leg is awaited with a _DOH_TIMEOUT cap, best-effort.

Refs #63309

Tests: 3 watchdog regressions (blocked-loop dump fires; responsive-loop
timeout does not; completed await does not) + 2 hung-resolver
regressions (DoH results returned promptly; worst-case seed fallback
stays bounded).
2026-07-14 17:09:50 +05:30
..
dingtalk fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
discord fix(approval): scope smart deny owner overrides to one operation 2026-07-13 04:31:55 -07:00
email fix(email): harden adapter against malformed IMAP responses 2026-07-02 03:12:53 -07:00
feishu fix(approval): scope smart deny owner overrides to one operation 2026-07-13 04:31:55 -07:00
google_chat refactor(setup): route dependency installs through the canonical uv→pip→ensurepip ladder 2026-07-07 04:09:35 -07:00
homeassistant fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
irc fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
line fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
matrix fix(approval): scope smart deny owner overrides to one operation 2026-07-13 04:31:55 -07:00
mattermost fix(mattermost): accept leading-space slash commands 2026-07-05 14:41:57 -07:00
ntfy fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
photon fix(photon): bound the sidecar dep self-heal npm run with a timeout 2026-07-05 17:38:32 -07:00
raft security(raft): enforce body-size limit on chunked requests 2026-07-05 13:57:37 -07:00
simplex fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
slack fix(approval): scope smart deny owner overrides to one operation 2026-07-13 04:31:55 -07:00
sms fix(sms): set client_max_size on the Twilio webhook Application 2026-07-05 17:38:36 -07:00
teams fix(approval): scope smart deny owner overrides to one operation 2026-07-13 04:31:55 -07:00
telegram fix(telegram): diagnose blocked-loop init hangs, unbind DoH from system DNS 2026-07-14 17:09:50 +05:30
wecom test(gateway): regression: every adapter.connect() must accept is_reconnect 2026-07-09 19:09:38 -07:00
whatsapp feat(gateway): attach MEDIA: caption to the media bubble on standalone sends 2026-07-09 15:38:32 +05:30