hermes-agent/gateway/platforms
Teknium f40b20d13c
fix(gateway): keep typing indicator alive across slow send_typing calls (#16763)
The typing-indicator refresh loop in BasePlatformAdapter._keep_typing
awaited each send_typing call unconditionally. Each call is an HTTP
round-trip to the platform API (Telegram/Discord), normally ~100ms. When
the same network instability that causes upstream provider timeouts
(e.g. Anthropic capacity blips slowing first-token latency past the
120s stream-read timeout) also slows the platform typing API to
multi-second response times, the refresh loop stalls inside the await.
Platform-side typing expires at ~5s, so the bubble dies and stays dead
until the stuck send_typing call returns — right when the user most
needs the 'still working' signal and instead sees a bot that looks
dead, then asks 'wtf are you doing' which itself interrupts the
eventually-recovering turn.

Bound each send_typing with asyncio.wait_for (1.5s cap, derived from
interval so it's always below the 2s cadence). Slow calls get abandoned
so the next scheduled tick fires a fresh send_typing on schedule. As
long as any one of them reaches the platform within its ~5s
typing-expiry window, the bubble stays visible across the stall.

Also catches non-timeout send_typing exceptions (transient HTTP errors)
so one bad tick doesn't terminate the whole loop.

Tests: 4 new in tests/gateway/test_keep_typing_timeout.py covering
slow-send non-blocking, fast-send still-awaited, exception resilience,
and paused-chat regression guard.
2026-04-27 19:09:32 -07:00
..
qqbot fix(qqbot): add backoff upper-bound check for QQCloseError reconnect path 2026-04-22 21:16:16 -07:00
__init__.py yuanbao platform (#16298) 2026-04-26 18:50:49 -07:00
ADDING_A_PLATFORM.md docs: finish cron terminology cleanup 2026-03-14 19:20:58 -07:00
api_server.py fix(api_server): cap stop-run wait at 5s so interrupt can't hang handler 2026-04-25 18:40:35 -07:00
base.py fix(gateway): keep typing indicator alive across slow send_typing calls (#16763) 2026-04-27 19:09:32 -07:00
bluebubbles.py fix(gateway/bluebubbles): align iMessage delivery with non-editable UX 2026-04-24 16:04:37 -07:00
dingtalk.py feat(dingtalk): AI Cards streaming, emoji reactions, and media handling 2026-04-17 19:26:53 -07:00
discord.py fix(ci): resolve follow-up title edge case and flaky checks 2026-04-27 11:49:02 -05:00
email.py fix(email): add required Date header to outbound mail 2026-04-27 06:41:11 -07:00
feishu.py fix(feishu): issue where streaming edits in Feishu show extra leading newlines 2026-04-23 03:02:09 -07:00
feishu_comment.py feat: add Feishu document comment intelligent reply with 3-tier access control 2026-04-17 19:04:11 -07:00
feishu_comment_rules.py fix(feishu-comment): use get_hermes_home(); drop dead asyncio wrapper; AUTHOR_MAP 2026-04-17 19:04:11 -07:00
helpers.py Fix MessageDeduplicator max_size enforcement 2026-04-26 18:51:51 -07:00
homeassistant.py fix(gateway): add request timeouts to HA, Email, Mattermost, SMS adapters (#3258) 2026-03-26 14:36:07 -07:00
matrix.py fix(matrix): close 'hall of mirrors' pairing + echo loop (#15763) (#16374) 2026-04-26 21:50:28 -07:00
mattermost.py refactor: remove redundant local imports already available at module level 2026-04-21 00:50:58 -07:00
signal.py fix(gateway): prevent scoped lock and resource leaks on connection failure 2026-04-20 01:44:36 -07:00
slack.py fix(slack): honor NO_PROXY for Slack transport 2026-04-26 18:33:35 -07:00
sms.py remove unused import and fix misleading log 2026-04-11 14:05:38 -07:00
telegram.py fix(telegram): accept /cmd@botname from bot menu in groups 2026-04-26 22:00:18 -07:00
telegram_network.py fix(telegram): honor no_proxy for explicit proxy setup 2026-04-24 14:31:04 -07:00
webhook.py fix(webhook): validate HMAC signature before rate limiting (#12544) 2026-04-19 22:45:08 -07:00
wecom.py fix(wecom): strip @mention prefix in group chats for slash command recognition 2026-04-23 02:00:56 -07:00
wecom_callback.py fix: activate WeCom callback message deduplication (#10305) (#10588) 2026-04-15 17:22:58 -07:00
wecom_crypto.py feat(gateway): add WeCom callback-mode adapter for self-built apps 2026-04-11 15:22:49 -07:00
weixin.py Fix Weixin media uploads and refresh lockfile 2026-04-17 06:50:36 -07:00
whatsapp.py refactor: remove remaining redundant local imports (comprehensive sweep) 2026-04-21 00:50:58 -07:00
yuanbao.py yuanbao platform (#16298) 2026-04-26 18:50:49 -07:00
yuanbao_media.py yuanbao platform (#16298) 2026-04-26 18:50:49 -07:00
yuanbao_proto.py yuanbao platform (#16298) 2026-04-26 18:50:49 -07:00
yuanbao_sticker.py yuanbao platform (#16298) 2026-04-26 18:50:49 -07:00