fix(discord): harden voice DAVE receive reliability#25909
Conversation
Reimplements and consolidates related work: - #24339 stale disconnect/destroyed session guards - #25312 voice listener cleanup on stop - #23036 restore @snazzah/davey runtime dependency Adds Discord voice DAVE config passthrough, repeated decrypt failure rejoin recovery, regression tests, docs, and changelog updates. Co-authored-by: Frank Yang <frank.ekn@gmail.com> Co-authored-by: Do Cao Hieu <admin@docaohieu.com>
PR SummaryMedium Risk Overview Hardens Written by Cursor Bugbot for commit 9cd50c5. This will update automatically on new commits. Configure here. |
|
Landed via fast-forward to Included commit:
What was landed:
Validation run before landing:
Thanks everyone who contributed the prior PRs/issues and repro detail. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cd50c51b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| logger.warn(`discord voice: decrypt recovery leave failed: ${leaveResult.message}`); | ||
| return; | ||
| } | ||
| const result = await this.join({ guildId: entry.guildId, channelId: entry.channelId }); |
There was a problem hiding this comment.
Revalidate active target before recovery rejoin
After recoverFromDecryptFailures calls leave, it always issues join back to the old entry.channelId without checking whether another join request has started meanwhile. In the concurrent case (for example, an operator runs /vc join to a different channel while decrypt recovery is in flight), this stale recovery path can race and pull the bot back to the previous channel or leave multiple live connections competing for the same guild, causing unstable voice behavior.
Useful? React with 👍 / 👎.
Summary
@snazzah/daveyruntime dependency for Discord VC DAVE support.channels.discord.voice.daveEncryptionchannels.discord.voice.decryptionFailureToleranceDecryptionFailed(...)) by triggering a rejoin attempt.Why
Discord inbound STT is currently unreliable under DAVE receive failures (
DecryptionFailed(UnencryptedWhenPassthroughDisabled)). This patch addresses the reliability regressions in OpenClaw's voice session lifecycle while exposing upstream DAVE knobs and improving recovery behavior.Related
Validation
pnpm lintpnpm buildpnpm testpnpm vitest run src/discord/voice/manager.test.tsDependency check (
@snazzah/davey)0.1.9(published 2025-12-19)Mintlify
0 threads from 0 users in Mintlify
Greptile Summary
This PR hardens Discord voice DAVE receive reliability by restoring the
@snazzah/daveyruntime dependency, adding first-class DAVE config passthrough (daveEncryption,decryptionFailureTolerance), implementing stale connection event guards, cleaning up voice listeners on session teardown, and adding a controlled rejoin recovery mechanism for repeated decrypt failures.@snazzah/daveyas a runtime dependency for@discordjs/voiceDAVE encryption supportchannels.discord.voice.daveEncryptionandchannels.discord.voice.decryptionFailureToleranceconfig options with full schema, help text, labels, and documentationDisconnected/Destroyedevent handlers against stale connections using aclearSessionIfCurrentidentity check, preventing accidental removal of new sessions when old connection events firespeaking,disconnected,destroyed,player error) duringstop(), preventing listener leaks across session lifecycleDecryptionFailed(...)errors within a 30-second window, triggers a leave+rejoin cycle with adecryptRecoveryInFlightguard to prevent concurrent recovery attemptsConfidence Score: 4/5
src/discord/voice/manager.ts— primary logic changes for DAVE recovery and session lifecycle hardeningLast reviewed commit: 9cd50c5