fix(telegram): re-trigger typing indicator after sending messages

Telegram clears the typing state when a new message is delivered.
When the agent sends intermediate progress messages (like 'Checking:'),
the '...typing' bubble disappears immediately and doesn't return until
the next keepalive tick (up to 2s later). This makes Hermes appear
unresponsive during multi-tool operations.

Fix: call send_typing() immediately after successful message delivery
to restart the typing indicator without waiting for the next keepalive tick.

Fixes #25836
This commit is contained in:
Spider-Verse 2026-05-15 04:39:28 +03:00 committed by Teknium
parent c9298bba06
commit 1856bd9cc8

View file

@ -1663,7 +1663,17 @@ class TelegramAdapter(BasePlatformAdapter):
continue
raise
message_ids.append(str(msg.message_id))
# Re-trigger typing indicator after sending a message.
# Telegram clears the typing state when a new message is delivered,
# so without this the "...typing" bubble disappears mid-response
# (especially noticeable when the agent sends intermediate progress
# messages like "Checking:" before running tools).
try:
await self.send_typing(chat_id, metadata=metadata)
except Exception:
pass # Typing failures are non-fatal
return SendResult(
success=True,
message_id=message_ids[0] if message_ids else None,