fix(discord): degrade audioAsVoice to media attachment when voice adapter unavailable#85173
fix(discord): degrade audioAsVoice to media attachment when voice adapter unavailable#85173JulyanXu wants to merge 1 commit into
Conversation
…pter unavailable When messages.tts.auto is set to "always", the TTS pipeline sets audioAsVoice=true on reply payloads. The outbound adapter then tried to route through discordVoice, falling back to sendVoiceMessageDiscord runtime. In cron delivery contexts where no voice channel connection exists, this fallback fails with "discordVoice outbound adapter is unavailable". Instead of falling back to the voice runtime (which cannot work without a voice connection), degrade gracefully: when the discordVoice dep is unavailable, fall through to the existing text+media delivery path which sends audio as a file attachment to the text channel. Closes openclaw#84952
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. by source inspection: cron announce calls durable batch delivery, durable delivery routes PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Move the downgrade decision into the Discord payload/voice path used by durable cron delivery, preserve voice delivery when a real voice sender or runtime is available, fall back to text/media only when voice is genuinely unavailable, and cover that with focused regression proof plus a real cron/Discord run. Do we have a high-confidence way to reproduce the issue? Yes by source inspection: cron announce calls durable batch delivery, durable delivery routes Is this the best way to solve the issue? No. The PR changes a plausible fallback branch, but the narrow maintainable fix needs to handle the actual Label changes:
Label justifications:
Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c8a35c4645dc. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
Heads up: this PR needs to be updated against current |
Summary
When
messages.tts.auto = "always", the TTS pipeline setsaudioAsVoice = trueon reply payloads. The Discord outbound adapter then attempted to route throughdiscordVoice, falling back tosendVoiceMessageDiscordruntime. In cron delivery contexts where no voice channel connection exists, this fallback fails with"discordVoice outbound adapter is unavailable".This fix removes the runtime fallback. When
discordVoiceis not available in deps, the code now falls through to the existing text+media delivery path, which sends audio as a file attachment to the text channel instead of failing.resolveOutboundSendDep(deps, "discordVoice")returns the voice function → voice delivery works as beforeCloses #84952
Verification
extensions/discord/src/outbound-adapter.tsaudioAsVoicebranch intercepted and failedReal behavior proof
discordVoice outbound adapter is unavailablewhenmessages.tts.auto = "always"messages.tts.auto = "always", run cron job with announce delivery to Discord text channel → after fix, audio is sent as attachment instead of failing