fix(gateway): pre-wire voice callbacks on Discord adapters at startup - #11160
fix(gateway): pre-wire voice callbacks on Discord adapters at startup#11160boroughnexus-cto wants to merge 1 commit into
Conversation
When the Discord adapter auto-joins a voice channel on startup (e.g. via DISCORD_VOICE_CHANNEL_ID or persistent voice config), the voice input and disconnect callbacks have not yet been set by GatewayRunner. The callbacks are wired lazily — only after the first join_voice_channel() call triggered by a user command. This means auto-joined channels receive voice audio with no handler attached, silently dropping all speech input until the user manually re-joins the bot. This fix iterates over Discord adapters after all platforms have connected and pre-wires the callbacks if they are not already set. Safe for non- auto-join deployments: callbacks are only set when currently None. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
RuckVibeCodes
left a comment
There was a problem hiding this comment.
[gus-first-pass] Addressing auto-join functionality for Discord effectively; well structured and tested.
|
Thanks for addressing the voice-input race. On current main, the stated startup path is not available: Discord voice channels are joined through Problems
Suggested changes
This is an automated hermes-sweeper review. |
|
You were the earliest submitter of the voice-callback-wiring idea (Apr 2026) — thank you! #73517 merged @isheng-eqi's #61407, which supersedes this with reconnect + channel-binding coverage; the merged PR credits you as earliest. (Landed via #73517, merge |
Summary
When the Discord adapter auto-joins a voice channel on startup (via persistent voice config), the voice input and disconnect callbacks (
_voice_input_callback,_on_voice_disconnect) have not yet been set byGatewayRunner. The gateway wires these callbacks lazily — only after the firstjoin_voice_channel()call triggered by a user command — so auto-joined channels receive voice audio with no handler attached, silently dropping all speech input.This fix iterates over Discord adapters in
GatewayRunner.connect()after all platforms have connected and pre-wires the callbacks if they are not already set.Changes
GatewayRunner.connect()after the "Gateway running" log lineNone— safe for non-auto-join deploymentsTest Scenario
DISCORD_VOICE_CHANNEL_ID=<channel_id>andDISCORD_VOICE_TIMEOUT=0in.envContext
We've been running this fix in production for several days via a local patch. The callback wiring gap affects all deployments using persistent/auto-join voice channels, not just our setup.
🤖 Generated with Claude Code