fix(gateway): stop typing indicator before sending response to prevent perpetual typing - #19278
Closed
JabberELF wants to merge 2 commits into
Closed
fix(gateway): stop typing indicator before sending response to prevent perpetual typing#19278JabberELF wants to merge 2 commits into
JabberELF wants to merge 2 commits into
Conversation
- cron delivery retry with exponential backoff - exclude cron sessions from resume and session listings - Nous auth fallback: pool exhausted -> auth.json - qwen temperature server-side support - codex command registration - macOS notify callback - FTS v12 external-content schema - user message scrollback text color fix
…t perpetual typing
In _process_message_background, _keep_typing refreshes the Telegram typing
indicator every 2 seconds during handler execution. When the handler returns
a response, the typing task was only stopped in the finally block — after
media extraction, TTS generation, and message sending. Since Telegram's
client clears the typing bubble when an incoming message arrives, but
_keep_typing fires another sendChatAction("typing") 2 seconds later, the
indicator perpetually toggles on and off.
Move _stop_typing_task() to right after the handler returns and before any
response processing. The outgoing message then naturally clears the typing
indicator per Telegram's documented behavior, and _keep_typing won't
re-trigger it.
The finally block's existing _stop_typing_task() becomes a harmless no-op
(already-cancelled tasks are idempotent).
This was referenced May 7, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In _process_message_background, the typing indicator was only stopped in the finally block - after media extraction, TTS generation, and message sending. Since _keep_typing refreshes sendChatAction(typing) every 2 seconds, it would re-trigger the typing bubble after the outgoing message had naturally cleared it.
Move _stop_typing_task() to right after the handler returns. The outgoing message then clears the typing indicator per Telegram's documented behavior, without _keep_typing re-triggering it.