hermes-agent/plugins/platforms
Brooklyn Nicholson c2cb37532c fix(telegram): add cause-agnostic wedged-recovery watchdog so the reconnect ladder can't freeze silently (#66377)
The Telegram gateway could go silently deaf for hours: the reconnect ladder
stalled mid-way (e.g. "attempt 4/10, reconnecting in 40s" then nothing) while
the process stayed active(running), so Restart=always never fired.

Root class: every recovery path — the ladder's re-entry
(_schedule_polling_recovery), the pending-update probe (_probe_pending_updates),
and PTB's error callback — gates new recovery on _polling_error_task.done(). If
that single task wedges on any hung await, all recovery returns early forever
and nothing retries.

The heartbeat loop is a separate task, so make it an independent, cause-agnostic
watchdog: if the same recovery task stays in-flight past
_POLLING_ERROR_TASK_STUCK_TIMEOUT (300s — well beyond a healthy ladder attempt's
bounded stop+drain+start+backoff), force a retryable-fatal so the background
reconnector rebuilds the adapter instead of relying on the frozen ladder. This
guarantees progress regardless of *where* the stall is (issue direction #1),
tracked locally so no task-assignment site needs to change.

Also salvages @koduri-mahesh-bhushan-chowdary's #66492 (drain-await timeout),
which closes the one concrete wedge vector documented in the incident
(_drain_polling_connections' unbounded shutdown()/initialize() on a wedged
CLOSE-WAIT pool). The watchdog covers the rest of the class.

Co-authored-by: Koduri Mahesh Bhushan Chowdary <mkoduri73@gmail.com>
2026-07-18 21:31:15 -04:00
..
dingtalk fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
discord fix(discord): keep recovery ledger I/O off event loop 2026-07-18 14:01:33 -07:00
email fix(email): harden adapter against malformed IMAP responses 2026-07-02 03:12:53 -07:00
feishu fix(security): widen non-ASCII compare_digest crash fix to all sibling sites 2026-07-16 07:22:24 -07:00
google_chat feat(gateway): make the working-state status text configurable 2026-07-18 12:28:59 -07:00
homeassistant fix(gateway): validate multiplex adapter config by platform 2026-07-16 05:39:58 -07:00
irc fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
line fix(security): widen non-ASCII compare_digest crash fix to all sibling sites 2026-07-16 07:22:24 -07:00
matrix feat(gateway): inline choice pickers for /reasoning and /fast (Telegram, Discord, Matrix) (#65799) 2026-07-16 10:38:31 -07:00
mattermost fix(gateway): validate multiplex adapter config by platform 2026-07-16 05:39:58 -07:00
ntfy fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
photon fix(photon): hide the npm dep self-heal console flashes on Windows too 2026-07-16 01:03:43 -07:00
raft fix(security): widen non-ASCII compare_digest crash fix to all sibling sites 2026-07-16 07:22:24 -07:00
simplex fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
slack fix(gateway): getattr-guard _status_text for bare-instance adapter tests 2026-07-18 12:28:59 -07:00
sms fix(security): widen non-ASCII compare_digest crash fix to all sibling sites 2026-07-16 07:22:24 -07:00
teams fix(approval): scope smart deny owner overrides to one operation 2026-07-13 04:31:55 -07:00
telegram fix(telegram): add cause-agnostic wedged-recovery watchdog so the reconnect ladder can't freeze silently (#66377) 2026-07-18 21:31:15 -04:00
wecom fix(gateway): gate profile routing on multiplex_profiles + widen batch-key routing to all adapters 2026-07-15 09:50:05 -07:00
whatsapp fix(gateway): gate profile routing on multiplex_profiles + widen batch-key routing to all adapters 2026-07-15 09:50:05 -07:00