Skip to content

fix(discord): stop typing indicator before response delivery - #38566

Closed
njiangk wants to merge 1 commit into
NousResearch:mainfrom
njiangk:fix/discord-typing-timing
Closed

fix(discord): stop typing indicator before response delivery#38566
njiangk wants to merge 1 commit into
NousResearch:mainfrom
njiangk:fix/discord-typing-timing

Conversation

@njiangk

@njiangk njiangk commented Jun 4, 2026

Copy link
Copy Markdown

Summary

Stop the persistent typing indicator before delivering the bot's reply, so the ~10s Discord typing bubble doesn't visually overlap the response text.

Root Cause

The existing stop_typing call lives in the finally block of the message-processing pipeline — it fires after the response is already sent over the wire. On Discord this means the "typing..." indicator persists for several seconds into the reply, obscuring the text.

Fix

Add an inner helper _stop_typing_now that is called just before the response dispatch path, before if not response: is evaluated. The cleanup-path stop_typing in the finally block is kept as a safety net for error/cancellation paths.

Test Plan

  • Existing gateway tests pass
  • Manual verification: Discord typing bubble now clears before reply appears

The persistent typing loop can keep the typing indicator active
past the moment the bot's reply is sent, causing a ~10s 'typing...'
bubble that visually overlaps the response text on Discord.

Move the typing stop from the generic cleanup path (which fires
after response delivery) to just before the response is sent,
ensuring the indicator is dismissed before the reply arrives.
@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/discord Discord bot adapter labels Jun 4, 2026
@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Thanks for this. The post-delivery typing-stop fix has landed on main via #37556 (merged as 6a30cfca8), which reorders _stop_typing_task() ahead of the post-delivery callback and bounds the callback with a timeout (also closing the root-cause issue #24971). Since this PR addresses the same boundary, I'm closing it as superseded — appreciate the contribution.

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/discord Discord bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants