Skip to content

fix(gateway): stop typing indicator before sending response to prevent perpetual typing - #19278

Closed
JabberELF wants to merge 2 commits into
NousResearch:mainfrom
JabberELF:feat/typing-indicator-fix
Closed

fix(gateway): stop typing indicator before sending response to prevent perpetual typing#19278
JabberELF wants to merge 2 commits into
NousResearch:mainfrom
JabberELF:feat/typing-indicator-fix

Conversation

@JabberELF

Copy link
Copy Markdown
Contributor

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.

zihao.zhao and others added 2 commits May 3, 2026 23:04
- 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).
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter labels May 3, 2026
@JabberELF

Copy link
Copy Markdown
Contributor Author

Closing — upstream independently addressed the same issue with #20959 and #25210. Keeping the branch for reference.

@JabberELF JabberELF closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants