openclaw - ✅(Solved) Fix Bug: Discord missing from OPUS_CHANNELS breaks native auto voice replies [4 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63931Fetched 2026-04-10 03:41:35
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×3commented ×1referenced ×1

Discord auto-TTS / auto voice-reply delivery does not route through the native Discord voice-message path because discord is missing from OPUS_CHANNELS in the speech-core runtime.

Error Message

  • manual explicit send via message(action=send, channel=discord, filePath=<ogg>, asVoice=true) works
  • native auto path sends the wrong format / wrong delivery mode
  • in practice this appeared as MP3 attachments and non-native voice delivery

Root Cause

The speech-core runtime decides whether TTS should target "voice-note" or "audio-file" based on whether the channel is in OPUS_CHANNELS.

Because discord is missing:

  • Discord does not get target: "voice-note"
  • providers like ElevenLabs do not mark the result as voiceCompatible
  • audioAsVoice is not set in the reply payload
  • route resolution does not call sendVoiceMessageDiscord()
  • result falls back to normal audio attachments (for example MP3) instead of native Discord voice messages

Fix Action

Fix / Workaround

Verification

After locally patching the installed runtime with discord added to OPUS_CHANNELS, a live test in Discord DM produced a correct native Discord voice message.

Notes

This local patch is effective immediately but not update-proof because it modifies the installed runtime bundle.

PR fix notes

PR #4: fix(speech-core): add discord to OPUS_CHANNELS for native voice-note TTS

Description (problem / solution / changelog)

Summary

Fixes #63931 — Discord missing from OPUS_CHANNELS breaks native auto voice replies.

Root Cause

In extensions/speech-core/src/tts.ts, the OPUS_CHANNELS Set did not include "discord". This caused TTS for Discord to fall back to MP3 attachment instead of using the native voice-note path (Opus codec).

const OPUS_CHANNELS = new Set(["telegram", "feishu", "whatsapp", "matrix", "discord"]);

(Added "discord" to the existing set of channels.)

Fix

Added "discord" to the OPUS_CHANNELS Set. The author of #63931 has locally verified this fix works.

Testing

The author confirmed the fix locally. CI should validate the change.

Closes #63931

Changed files

  • extensions/speech-core/src/tts.ts (modified, +1/-1)
  • extensions/telegram/src/outbound-adapter.test.ts (modified, +82/-0)
  • extensions/telegram/src/outbound-adapter.ts (modified, +14/-0)
  • src/agents/pi-tools.ts (modified, +5/-1)
  • src/agents/tool-policy.test.ts (modified, +24/-0)
  • src/agents/tool-policy.ts (modified, +19/-2)

PR #63950: fix(speech-core): add discord to OPUS_CHANNELS for native voice-note TTS

Description (problem / solution / changelog)

Summary

Fixes #63931 — Discord missing from OPUS_CHANNELS breaks native auto voice replies.

Root Cause

In extensions/speech-core/src/tts.ts, the OPUS_CHANNELS Set did not include "discord". This caused TTS for Discord to fall back to MP3 attachment instead of using the native voice-note path (Opus codec).

const OPUS_CHANNELS = new Set(["telegram", "feishu", "whatsapp", "matrix", "discord"]);

(Added "discord" to the existing set of channels.)

Fix

Added "discord" to the OPUS_CHANNELS Set. The author of #63931 has locally verified this fix works.

Testing

The author confirmed the fix locally. CI should validate the change.

Closes #63931

Changed files

  • extensions/speech-core/src/tts.ts (modified, +1/-1)
  • src/agents/pi-tools.ts (modified, +5/-1)
  • src/agents/tool-policy.test.ts (modified, +24/-0)
  • src/agents/tool-policy.ts (modified, +19/-2)

PR #64045: fix: add discord to OPUS_CHANNELS to enable native auto voice replies

Description (problem / solution / changelog)

Summary

Add discord to the OPUS_CHANNELS set in extensions/speech-core/src/tts.ts so that Discord can use native Opus-encoded voice replies instead of falling back to audio-file attachments.

Fix

-const OPUS_CHANNELS = new Set(["telegram", "feishu", "whatsapp", "matrix"]);
+const OPUS_CHANNELS = new Set(["telegram", "feishu", "whatsapp", "matrix", "discord"]);

Issue

Fixes #63931

Testing

Author locally verified.

Changed files

  • extensions/discord/src/shared.ts (modified, +2/-1)
  • extensions/speech-core/src/tts.ts (modified, +1/-1)
  • src/agents/pi-tools.ts (modified, +5/-1)
  • src/agents/tool-policy.test.ts (modified, +24/-0)
  • src/agents/tool-policy.ts (modified, +19/-2)
  • src/media-understanding/openai-compatible-audio.ts (modified, +3/-0)

PR #64096: fix(speech-core): add discord to OPUS_CHANNELS for native voice-note TTS

Description (problem / solution / changelog)

Summary

  • Problem: extensions/speech-core/src/tts.ts did not treat Discord as an Opus-capable voice-note channel in the auto-TTS path.
  • Why it matters: Discord auto voice replies fell back to regular audio attachments instead of native voice messages.
  • What changed: added discord to OPUS_CHANNELS and added a focused regression test that locks in Discord auto-TTS voice-note routing.
  • What did NOT change (scope boundary): no Discord delivery code, provider-specific synthesis logic, or non-Discord channel behavior changed.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #63931
  • Related #63950
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: the speech-core runtime chose target: "audio-file" for Discord because discord was missing from OPUS_CHANNELS.
  • Missing detection / guardrail: there was no regression test asserting that Discord auto-TTS uses the voice-note path.
  • Contributing context (if known): #63950 already had the same one-line runtime fix, but that PR was closed for PR-queue reasons rather than because the fix was incorrect.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: extensions/speech-core/src/tts.test.ts
  • Scenario the test should lock in: Discord auto TTS should synthesize with target: "voice-note" and return audioAsVoice: true for a voice-compatible result.
  • Why this is the smallest reliable guardrail: it exercises the exact speech-core decision point that controls Discord's auto voice-note routing without needing live Discord or provider credentials.
  • Existing test that already covers this (if any): None.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

Discord auto TTS / auto voice replies now route through the native voice-note path instead of falling back to regular audio attachments when the synthesis result is voice-compatible.

Diagram (if applicable)

Before:
[Discord auto TTS] -> [channel not in OPUS_CHANNELS] -> [target: audio-file] -> [regular audio attachment]

After:
[Discord auto TTS] -> [channel in OPUS_CHANNELS] -> [target: voice-note] -> [native Discord voice message]

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS (darwin arm64)
  • Runtime/container: Node 22 / pnpm workspace
  • Model/provider: mocked speech provider in unit test
  • Integration/channel (if any): Discord
  • Relevant config (redacted): messages.tts.enabled=true, messages.tts.provider=mock

Steps

  1. Run pnpm test extensions/speech-core/src/tts.test.ts.
  2. Let the test call maybeApplyTtsToPayload for channel: "discord" with a mock provider that only marks voice output as compatible when target === "voice-note".
  3. Assert the synthesize request uses target: "voice-note" and the resulting payload sets audioAsVoice: true.

Expected

  • Discord auto TTS uses the voice-note path.
  • The returned payload is marked for native voice delivery.

Actual

  • Verified locally after the fix.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: added and ran pnpm test extensions/speech-core/src/tts.test.ts locally; the test passed and asserted both target: "voice-note" and audioAsVoice: true for Discord.
  • Edge cases checked: the mock provider only reports voiceCompatible when the request target is the voice-note path, so the test guards both the target selection and the final payload flag.
  • What you did not verify: live Discord delivery, full repo-wide pnpm check, and broader integration suites.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps:

Risks and Mitigations

  • Risk: the regression test mocks channel normalization instead of booting the full channel registry.
    • Mitigation: the test intentionally isolates the speech-core decision path and asserts the exact voice-note target and payload flag that regressed here.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/speech-core/src/tts.test.ts (added, +99/-0)
  • extensions/speech-core/src/tts.ts (modified, +1/-1)

Code Example

const OPUS_CHANNELS = new Set([
  "telegram",
  "feishu",
  "whatsapp",
  "matrix"
]);

---

const OPUS_CHANNELS = new Set([
  "telegram",
  "feishu",
  "whatsapp",
  "matrix",
  "discord"
]);
RAW_BUFFERClick to expand / collapse

Bug Report: Discord missing from OPUS_CHANNELS breaks native auto voice replies

Summary

Discord auto-TTS / auto voice-reply delivery does not route through the native Discord voice-message path because discord is missing from OPUS_CHANNELS in the speech-core runtime.

Affected file

dist/extensions/speech-core/runtime-api.js

Relevant block before fix:

const OPUS_CHANNELS = new Set([
  "telegram",
  "feishu",
  "whatsapp",
  "matrix"
]);

Root cause

The speech-core runtime decides whether TTS should target "voice-note" or "audio-file" based on whether the channel is in OPUS_CHANNELS.

Because discord is missing:

  • Discord does not get target: "voice-note"
  • providers like ElevenLabs do not mark the result as voiceCompatible
  • audioAsVoice is not set in the reply payload
  • route resolution does not call sendVoiceMessageDiscord()
  • result falls back to normal audio attachments (for example MP3) instead of native Discord voice messages

Observed behavior

  • manual explicit send via message(action=send, channel=discord, filePath=<ogg>, asVoice=true) works
  • native auto path sends the wrong format / wrong delivery mode
  • in practice this appeared as MP3 attachments and non-native voice delivery

Expected behavior

Discord should be treated like other Opus / voice-note capable channels in the speech-core auto-TTS path so that native Discord voice messages are produced automatically.

Minimal fix

Add "discord" to OPUS_CHANNELS.

const OPUS_CHANNELS = new Set([
  "telegram",
  "feishu",
  "whatsapp",
  "matrix",
  "discord"
]);

Verification

After locally patching the installed runtime with discord added to OPUS_CHANNELS, a live test in Discord DM produced a correct native Discord voice message.

Notes

This local patch is effective immediately but not update-proof because it modifies the installed runtime bundle.

extent analysis

TL;DR

Add "discord" to the OPUS_CHANNELS set in the runtime-api.js file to enable native Discord voice messages for auto-TTS.

Guidance

  • Identify the OPUS_CHANNELS set in dist/extensions/speech-core/runtime-api.js and add "discord" to it.
  • Verify the fix by testing auto-TTS in a Discord DM and checking if a native Discord voice message is produced.
  • Consider updating the speech-core runtime to a version that includes the fix, if available, to ensure the change is persistent across updates.
  • Be aware that manually patching the installed runtime bundle may not be update-proof.

Example

const OPUS_CHANNELS = new Set([
  "telegram",
  "feishu",
  "whatsapp",
  "matrix",
  "discord"
]);

Notes

The provided fix is specific to the runtime-api.js file and may need to be reapplied if the speech-core runtime is updated.

Recommendation

Apply the workaround by adding "discord" to the OPUS_CHANNELS set, as this is a direct fix for the identified issue and allows for native Discord voice messages to be produced automatically.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Discord should be treated like other Opus / voice-note capable channels in the speech-core auto-TTS path so that native Discord voice messages are produced automatically.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Bug: Discord missing from OPUS_CHANNELS breaks native auto voice replies [4 pull requests, 1 comments, 2 participants]