Skip to content

feat: add real-time Qwen voice conversations - #44

Closed
Zeptiny wants to merge 3 commits into
mainfrom
feat/qwen-realtime-voice
Closed

Zeptiny wants to merge 3 commits into
mainfrom
feat/qwen-realtime-voice

Conversation

@Zeptiny

@Zeptiny Zeptiny commented Nov 9, 2026

Copy link
Copy Markdown
Owner

QuillBot can now converse with people in Discord voice channels through Token Plan's qwen-audio-3.0-realtime-plus. /voice entrar joins the caller's channel, streams incoming speech to Qwen, and plays spoken replies; /voice sair disconnects and /voice status reports the active session.

The integration handles Discord DAVE decryption, PCM conversion, streaming playback, and interruptions. Each server gets a separate session with its configured personality. Sessions close on empty channels, disconnects, errors, inactivity, or the duration limit. A public notice explains audio processing before capture starts, and the bot does not persist audio or transcripts. Voice sessions do not access text history, memory, or tools.

Adds environment configuration, setup documentation, voice dependencies, and Opus support in Docker. Configure TOKEN_PLAN_API_KEY (fallback: ANTHROPIC_AUTH_TOKEN), update dependencies or rebuild the image, and grant View Channel, Connect, Speak, and Send Messages in the voice channel. The default endpoint is Singapore and can be changed for the subscription's region.

Validation:

  • Full test suite: 257 passed, including 35 voice tests covering audio conversion, protocol ordering, interruptions, permissions, concurrent joins, and cleanup.
  • ruff check . and git diff --check pass.
  • Discord cog registration and unload smoke check passes.
  • Live Discord/Qwen audio remains unverified because bot and Token Plan credentials were unavailable in the development environment.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 11215d24-ff7a-4ecc-8af4-9ef2127d4bf5
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

voice_recv leaves RTP padding octets in decrypted_data; passing the padded
payload to dave_session.decrypt() failed authentication, and write() dropped
every speech packet. Qwen received digital silence, generated no response,
and the provider closed the session after 180s with response_idle_timeout,
which the bot reported as a key/region problem.

- remove RTP padding before DAVE decryption in DiscordInput
- translate provider error codes honestly; log the code, never the payload
- pick the receiver's VoiceError over the sender's socket close in run()
- default VOICE_IDLE_TIMEOUT_SECONDS 300 -> 150 so the bot leaves before the
  provider's 180s no-response limit
- privacy-safe input counters + 15s voiced-frame stats log to diagnose
  remaining silent-drop paths live
…t stats

All speech packets now fail inside dave_session.decrypt(), which splits the
diagnosis into missing MLS keys vs malformed frames. Extend the 15s input
stats line with the DAVE session snapshot (status/epoch/members, per-speaker
davey decryption stats, outbound encryption stats) and capture the first
decrypt exception text, so the next live run pinpoints the failing stage.
@Zeptiny Zeptiny closed this Nov 9, 2026
@Zeptiny
Zeptiny deleted the feat/qwen-realtime-voice branch November 9, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant