Skip to content

fix(discord): make voice idle timeout configurable#11419

Open
oqpsk wants to merge 1 commit into
NousResearch:mainfrom
oqpsk:fix/discord-voice-timeout-config
Open

fix(discord): make voice idle timeout configurable#11419
oqpsk wants to merge 1 commit into
NousResearch:mainfrom
oqpsk:fix/discord-voice-timeout-config

Conversation

@oqpsk

@oqpsk oqpsk commented Apr 17, 2026

Copy link
Copy Markdown

Summary

  • expose Discord voice idle timeout via discord.voice_timeout_seconds in config.yaml
  • bridge it to DISCORD_VOICE_TIMEOUT_SECONDS and read it in the Discord adapter
  • document the new setting and cover config/default voice timeout behavior with tests

Test Plan

  • source venv/bin/activate && python -m pytest tests/gateway/test_config.py tests/gateway/test_discord_connect.py tests/gateway/test_voice_command.py -q

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have platform/discord Discord bot adapter comp/gateway Gateway runner, session dispatch, delivery labels Apr 25, 2026
@lucas-torreao

Copy link
Copy Markdown

Great PR! I've been working on related Discord voice fixes and have complementary changes that would pair well with this. Let me share what I found and what I can contribute.

Overlapping Work

I independently implemented a similar configurable timeout, but via a @property pattern that reads from PlatformConfig.extra → env var → default, rather than parsing in __init__. Both approaches are valid — yours is more straightforward with the max(0, ...) handling.

Complementary Fixes I Can Contribute

1. Timer reset on user speech (critical bug fix)

The bot leaves mid-conversation because receiving voice input doesn't reset the inactivity timer. One-liner in _process_voice_input():

# After transcript is finalized, before callback:
self._reset_voice_timeout(guild_id)

This is the root cause of user reports about the bot dropping during active voice conversations — the timer keeps ticking even while the user is speaking.

2. Config bridge extra dict fix (gateway/config.py)

The bridge code (~L719-780) maps individual config keys from YAML to PlatformConfig.extra, but never merges platform_cfg.get("extra", {}) into the extra dict. This silently drops any discord.extra.* keys in config.yaml.

3. Playback timeout configurable

Same @property pattern for PLAYBACK_TIMEOUT (hardcoded at 120s). Useful for slow TTS providers or debugging.

4. STT device override (tools/transcription_tools.py)

Respects stt.local.device from config to skip CUDA auto-detect when you know you want CPU.

Suggested Approach

I'm happy to:

  • Fork your branch and add commits 1-3 on top (timer reset + bridge fix + playback timeout), keeping your approach as the base
  • Or open a separate follow-up PR that builds on top of yours once merged
  • Or share clean patches for you to cherry-pick

What works best for you?

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 P3 Low — cosmetic, nice to have platform/discord Discord bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants