Skip to content

fix(discord): make voice timeouts configurable - #50533

Closed
namredips wants to merge 2 commits into
NousResearch:mainfrom
namredips:fix/discord-voice-timeout-config
Closed

namredips wants to merge 2 commits into
NousResearch:mainfrom
namredips:fix/discord-voice-timeout-config

Conversation

@namredips

Copy link
Copy Markdown
Contributor

Summary

  • Add configurable Discord voice-channel inactivity timeout (discord.voice_channel_inactivity_timeout_seconds), including 0 to disable auto-leave.
  • Add configurable Discord VC playback timeout floor (discord.voice_playback_timeout_seconds).
  • Size the effective playback watchdog from the generated audio duration plus padding so long TTS readbacks are not cut off at a hard 120 seconds.
  • Treat playback as voice activity by cancelling the inactivity timer while probing/decoding/speaking and re-arming it in a finally block.
  • Document the new Discord config keys and add regression tests for config loading, disabled auto-leave, duration-aware playback timeout, and timer re-arming.

Test Plan

  • uv run --with pytest-asyncio pytest tests/gateway/test_voice_command.py tests/gateway/test_discord_connect.py tests/gateway/test_discord_voice_mixer.py -q
  • uv run ruff check plugins/platforms/discord/adapter.py hermes_cli/config.py tests/gateway/test_voice_command.py tests/gateway/test_discord_voice_mixer.py
  • git diff --check
  • Static added-line scan for hardcoded secrets, shell=True, eval/exec, pickle loads, and obvious SQL string formatting: clean.

Notes

  • Defaults preserve current behavior: 300-second inactivity auto-leave and a 120-second playback watchdog floor.
  • voice_playback_timeout_seconds remains a floor, not a hard cap. Long clips wait for duration + 30s when that exceeds the configured floor.

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

Copy link
Copy Markdown
Collaborator

Thanks for the focused Discord voice work. The underlying issue remains on current main: VOICE_TIMEOUT = 300 and PLAYBACK_TIMEOUT = 120 are still hardcoded in plugins/platforms/discord/adapter.py:816,2925 and used by the playback waits at :2955, :2974, and :2992.

Problems

  • In commit a8c96a95, the new integer helper clamps with max(minimum, value). A value of -1 therefore disables inactivity auto-leave, and a negative playback value becomes a one-second watchdog. Linked issue Make Discord voice inactivity timeout configurable #17790 requests invalid values fall back to defaults; add validation and regression coverage for negative values.
  • The branch predates cc8e5ec2afbfd10a3cff4e710210dd9ecae64a33, which moved Discord into the bundled plugin and made plugins/platforms/discord/adapter.py::_apply_yaml_config (:8229) the YAML-resolution owner. The PR is currently conflicting and needs a thoughtful salvage onto that structure.

Suggested changes

  • Preserve only documented 0 disable semantics; reject negative/malformed values to defaults.
  • Reapply through the current plugin configuration path and add an end-to-end resolution test.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

Merged into main via consolidated salvage PR #73517 (merge b8c38a451a). Your configurable voice inactivity/playback timeouts (replacing hardcoded VOICE_TIMEOUT = 300; playback no longer counts as inactivity) were cherry-picked with your authorship; only the frozen AUTHOR_MAP hunk was dropped.

Your contribution is credited to you in git history. Thank you! Closing this PR as merged-via-salvage.

@teknium1 teknium1 closed this Jul 29, 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 P3 Low — cosmetic, nice to have platform/discord Discord bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants