fix(discord): handle ffmpeg stderr stream errors in voice playback#101088
Merged
steipete merged 2 commits intoJul 6, 2026
Merged
Conversation
createDiscordOpusPlaybackStream guards ffmpeg stdout and stdin against raw stream 'error' events (an unhandled stream error throws and crashes the gateway via uncaughtException), but the stderr stream on the same child was left unguarded. Add the symmetric stderr error handler, routing it through opusStream.destroy like stdout. Add a regression test covering stdout and stderr stream errors.
steipete
force-pushed
the
fix/discord-voice-stderr-stream-error
branch
from
July 6, 2026 18:29
86133cb to
258f6fb
Compare
Contributor
|
Maintainer pass complete on
I also attempted isolated, secretless AWS Crabbox validation twice. The coordinator reset during its own deployment before either lease was created, so no contributor code ran there; exact-head GitHub CI is the execution gate. Thanks @masatohoshino for finding and testing the Discord voice crash path. |
Contributor
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 7, 2026
…penclaw#101088) * fix(discord): handle ffmpeg stderr stream errors in voice playback createDiscordOpusPlaybackStream guards ffmpeg stdout and stdin against raw stream 'error' events (an unhandled stream error throws and crashes the gateway via uncaughtException), but the stderr stream on the same child was left unguarded. Add the symmetric stderr error handler, routing it through opusStream.destroy like stdout. Add a regression test covering stdout and stderr stream errors. * refactor(discord): unify ffmpeg stream errors --------- Co-authored-by: Peter Steinberger <[email protected]>
giodl73-repo
pushed a commit
to giodl73-repo/openclaw
that referenced
this pull request
Jul 8, 2026
…penclaw#101088) * fix(discord): handle ffmpeg stderr stream errors in voice playback createDiscordOpusPlaybackStream guards ffmpeg stdout and stdin against raw stream 'error' events (an unhandled stream error throws and crashes the gateway via uncaughtException), but the stderr stream on the same child was left unguarded. Add the symmetric stderr error handler, routing it through opusStream.destroy like stdout. Add a regression test covering stdout and stderr stream errors. * refactor(discord): unify ffmpeg stream errors --------- Co-authored-by: Peter Steinberger <[email protected]>
This was referenced Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
createDiscordOpusPlaybackStreamguarded ffmpeg's stdout stream but left stderr's ownerrorevent unhandled. Node rethrows an unhandled EventEmittererror, so a broken stderr pipe could terminate the gateway instead of failing only the Discord voice playback stream.Why This Change Was Made
Both readable child pipes have the same lifecycle contract. This change installs the same error forwarding on stdout and stderr in one loop, while preserving stderr data capture for ffmpeg diagnostics. The existing stdin
EPIPEhandling remains separate because it intentionally suppresses write-side shutdown noise.User Impact
A broken ffmpeg stdout or stderr pipe during Discord voice playback now destroys the playback stream with the original error instead of risking an uncaught process-level exception. Normal decoding and playback are unchanged.
Evidence
oxfmt --checkandgit diff --check: clean.258f6fb073b55976ed502e31d68e10a34964374a.errorwithout a listener throws and exits the process: https://nodejs.org/api/events.html#error-eventsDirect sanitized AWS Crabbox proof was attempted twice, but the coordinator reset during its own deployment before a lease or PR execution began. Secretless exact-head GitHub CI therefore remains the execution proof.