Skip to content

[Bug]: Matrix message tool ignores audioAsVoice parameter #32489

@itsdoublearon

Description

@itsdoublearon

Bug type

Behavior bug (incorrect output/state without crash)

Summary

The message tool's audioAsVoice parameter is not wired to the Matrix channel plugin, causing audio files to be sent as generic m.file attachments instead of m.audio voice messages (MSC3245).

Steps to reproduce

  1. Configure Matrix channel (already ON/OK)
  2. Generate OGG/Opus audio file: curl -X POST http://localhost:8877/v1/audio/speech -d '{"input":"test","voice":"af_heart","response_format":"opus"}' -o voice.ogg
  3. Send via message tool with voice flag: { "action": "send", "channel": "matrix", "media": "./voice.ogg", "mimeType": "audio/ogg; codecs=opus", "asVoice": true }
  4. Try alternate parameter: { "audioAsVoice": true }

Expected behavior

Audio should appear as an inline voice message bubble (playable inline) using MSC3245 format with org.matrix.msc3245.voice metadata and duration info.

Actual behavior

Audio appears as a file attachment (downloadable file) instead of inline voice player. Matrix event shows msgtype: "m.file" instead of msgtype: "m.audio" with voice metadata.

OpenClaw version

2026.3.1

Operating system

Linux 6.12.48+deb13-amd64 (Docker)

Install method

No response

Logs, screenshots, and evidence

| Test | Parameter | Result |
|------|-----------|--------|
| Test 1 | `asVoice: true` | ❌ File attachment |
| Test 2 | `audioAsVoice: true` | ❌ File attachment |
| Test 3 | Various `mimeType` combos | ❌ File attachment |
| Test 4 | Resend user's own voice file via `media` | ❌ File attachment |
| Control | User's file sent natively from Element | ✅ Inline voice player |

Matrix plugin (`send.ts`, `media.ts`) supports `audioAsVoice` internally and injects proper MSC3245 metadata, but the `message` tool abstraction layer doesn't pass this parameter to the channel.

Impact and severity

  • Affected: Matrix users wanting voice message automation
  • Severity: Medium (feature gap — voice messages technically supported but inaccessible)
  • Frequency: 100% repro when using message tool
  • Consequence: Cannot send voice messages programmatically; workaround requires browser automation or manual Element client use
  • Not a regression: Feature appears never to have been wired through tool layer

Additional information

Related code locations:

  • Matrix plugin supports voice: /extensions/matrix/src/matrix/send/media.ts (lines ~60-70 inject org.matrix.msc3245.voice)
  • message tool definition: Tool schema doesn't expose audioAsVoice for Matrix channel

Suggested fix: Either:

  1. Add audioAsVoice parameter to message tool schema and wire to Matrix sendMedia() call
  2. Auto-detect opus/ogg audio and default to voice message format for Matrix

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    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