Refine typing indicator behavior in message handling

- Adjusted the `_keep_typing` method to refresh the typing indicator every 2 seconds instead of 4, improving responsiveness after progress messages.
- Updated the `GatewayRunner` to restore the typing indicator after sending progress messages, enhancing user experience during message processing.
This commit is contained in:
teknium1 2026-02-03 15:06:18 -08:00
parent 488deb04a4
commit 221fb17c5e
2 changed files with 6 additions and 3 deletions

View file

@ -172,11 +172,12 @@ class BasePlatformAdapter(ABC):
"""
pass
async def _keep_typing(self, chat_id: str, interval: float = 4.0) -> None:
async def _keep_typing(self, chat_id: str, interval: float = 2.0) -> None:
"""
Continuously send typing indicator until cancelled.
Telegram/Discord typing status expires after ~5 seconds, so we refresh every 4.
Telegram/Discord typing status expires after ~5 seconds, so we refresh every 2
to recover quickly after progress messages interrupt it.
"""
try:
while True: