Skip to content

Matrix TTS replies not sent as voice bubbles — missing from VOICE_BUBBLE_CHANNELS #37061

@gucasbrg

Description

@gucasbrg

Bug type

Behavior bug (incorrect output/state without crash)

Summary

When messages.tts.auto: "inbound" is configured and a user sends a voice message on Matrix, the TTS reply audio is sent as a generic audio file attachment instead of a native voice message bubble (MSC3245). This is because "matrix" is not included in the VOICE_BUBBLE_CHANNELS set in src/tts/tts.ts.

Root Cause

In the TTS pipeline (src/tts/tts.ts):

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

Matrix is missing from this set. This causes two cascading issues:

  1. resolveOutputFormat("matrix") returns DEFAULT_OUTPUT with openai: "mp3" and voiceCompatible: false instead of TELEGRAM_OUTPUT with openai: "opus" and voiceCompatible: true
  2. The reply dispatcher sets audioAsVoice: result.voiceCompatible === truefalse, so the Matrix send pipeline never applies MSC3245 voice metadata

Even though extensions/matrix/src/matrix/send.ts fully supports audioAsVoice and correctly injects org.matrix.msc3245.voice + org.matrix.msc1767.audio, the TTS pipeline never sets this flag for Matrix.

Steps to reproduce

  1. Configure messages.tts.auto: "inbound" and an OpenAI-compatible TTS provider
  2. Send a voice message to the bot on Matrix (Element)
  3. Bot transcribes, generates a reply, and runs TTS
  4. TTS audio is sent as a generic file attachment, not a voice bubble

Expected behavior

TTS replies on Matrix should:

  • Use Opus format (like Telegram/Feishu/WhatsApp)
  • Set voiceCompatible: true
  • Be sent as MSC3245 voice message bubbles with waveform, duration, and inline playback

Actual behavior

TTS replies on Matrix:

  • Use MP3 format (DEFAULT_OUTPUT)
  • Set voiceCompatible: false
  • Appear as downloadable file attachments without inline playback

Suggested fix

Add "matrix" to VOICE_BUBBLE_CHANNELS:

const VOICE_BUBBLE_CHANNELS = new Set([
  "telegram",
  "feishu",
  "whatsapp",
  "matrix",  // Matrix supports MSC3245 voice messages
]);

This would make the TTS pipeline use Opus format and set voiceCompatible: true for Matrix, enabling native voice bubbles.

Related issues

Environment

  • OpenClaw version: 2026.3.1
  • Channel: Matrix (Element Web/Desktop)
  • TTS provider: OpenAI-compatible (custom endpoint)

Impact

  • Affected: All Matrix users receiving TTS auto-replies
  • Severity: Medium — voice reply works but UX is poor (file download vs inline playback)
  • Frequency: 100% for Matrix TTS replies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions