openclaw - 💡(How to fix) Fix [Bug] TTS sends duplicate text + audio, and format not configurable per channel [1 comments, 1 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#70092Fetched 2026-04-23 07:29:25
View on GitHub
Comments
1
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
commented ×1

Code Example

function hasAssistantVisibleReply(params) {
    return resolveSendableOutboundReplyParts(params).hasContent || Boolean(params.audioAsVoice);
}
RAW_BUFFERClick to expand / collapse

Bug Description

Issue 1 — TTS sends duplicate text + voice message

When the built-in TTS tool returns audioAsVoice: true, OpenClaw sends BOTH:

  1. Text content: `"Generated audio reply."`
  2. Audio attachment with audioAsVoice: true

This results in two separate messages on messaging channels (Feishu, WeChat, etc.) — a redundant text bubble and the voice bubble. The audioAsVoice=true flag should suppress the text entirely.

Issue 2 — TTS output format not configurable per channel

The messages.tts config section has no way to define output path or audio format. TTS always outputs mp3, but Feishu requires opus/ogg for native voice messages. There's no channel-specific format override.

Expected Behavior

  1. When audioAsVoice=true, only the audio message should be sent — no accompanying text
  2. TTS config should support output format/path, or at minimum allow per-channel format specification

Environment

  • OpenClaw version: (latest)
  • Channel: Feishu, WeChat
  • TTS provider: minimax

Relevant Code

The issue appears to be in the hasAssistantVisibleReply function:

function hasAssistantVisibleReply(params) {
    return resolveSendableOutboundReplyParts(params).hasContent || Boolean(params.audioAsVoice);
}

The || Boolean(params.audioAsVoice) causes an empty text payload to still be treated as a valid reply when audio is present.

extent analysis

TL;DR

The issue can be resolved by modifying the hasAssistantVisibleReply function to correctly handle the audioAsVoice flag and by adding support for configurable TTS output formats per channel.

Guidance

  • Review the hasAssistantVisibleReply function to ensure it correctly checks for the presence of text content when audioAsVoice is true, potentially by changing the condition to return resolveSendableOutboundReplyParts(params).hasContent && !params.audioAsVoice;
  • Investigate adding a configuration option to the messages.tts section to allow specification of output format or path, or to enable per-channel format overrides
  • Consider adding a check for the channel type (e.g., Feishu, WeChat) to determine the required audio format (e.g., opus/ogg for Feishu)
  • Verify that the TTS provider (minimax) supports the required audio formats and can be configured accordingly

Example

function hasAssistantVisibleReply(params) {
    // Only consider text content if audioAsVoice is false
    return resolveSendableOutboundReplyParts(params).hasContent && !params.audioAsVoice;
}

Notes

The provided code snippet only addresses Issue 1, and a more comprehensive solution would require additional changes to support configurable TTS output formats per channel.

Recommendation

Apply a workaround by modifying the hasAssistantVisibleReply function as suggested, and consider adding support for configurable TTS output formats per channel in a future update, as this would require more significant changes to the codebase.

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…

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 - 💡(How to fix) Fix [Bug] TTS sends duplicate text + audio, and format not configurable per channel [1 comments, 1 participants]