openclaw - 💡(How to fix) Fix TTS tags not processed in cron announce delivery [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

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#52125Fetched 2026-04-08 01:15:18
View on GitHub
Comments
2
Participants
3
Timeline
3
Reactions
1
Timeline (top)
commented ×2subscribed ×1

[[tts]] and [[tts:text]] tags in agent replies are not processed when delivered via cron job announce mode. The tags render as raw text in Telegram instead of generating voice notes.

Root Cause

[[tts]] and [[tts:text]] tags in agent replies are not processed when delivered via cron job announce mode. The tags render as raw text in Telegram instead of generating voice notes.

Fix Action

Fix / Workaround

This is important for use cases like scheduled morning briefings that include a spoken summary alongside the written report. The workaround is to remove TTS instructions from cron jobs, but ideally the announce delivery path should run through the same TTS pipeline as direct replies.

Code Example

{
  "messages": {
    "tts": {
      "auto": "tagged",
      "provider": "microsoft",
      "microsoft": { "enabled": true, "voice": "en-US-AvaMultilingualNeural" }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Summary

[[tts]] and [[tts:text]] tags in agent replies are not processed when delivered via cron job announce mode. The tags render as raw text in Telegram instead of generating voice notes.

Steps to Reproduce

  1. Configure TTS in openclaw.json:
{
  "messages": {
    "tts": {
      "auto": "tagged",
      "provider": "microsoft",
      "microsoft": { "enabled": true, "voice": "en-US-AvaMultilingualNeural" }
    }
  }
}
  1. Create a cron job with sessionTarget: "isolated" and delivery.mode: "announce"
  2. In the payload message, instruct the agent to include [[tts]] in its reply
  3. The agent includes the tag, but the delivered message shows raw [[tts]] text — no audio is generated

Expected Behavior

The TTS pipeline (maybeApplyTtsToPayload) should process outbound replies from cron announce delivery the same way it processes direct agent replies. Voice notes should be generated and attached.

Actual Behavior

  • Direct replies (user sends message → agent replies): TTS works correctly, voice note attached ✅
  • Cron announce delivery: TTS tags ignored, raw text displayed ❌

Environment

  • OpenClaw: 2026.3.14 (6a6f1b5)
  • Channel: Telegram
  • TTS Provider: Microsoft (node-edge-tts)
  • Node: v25.6.1
  • OS: macOS (arm64)

Notes

This is important for use cases like scheduled morning briefings that include a spoken summary alongside the written report. The workaround is to remove TTS instructions from cron jobs, but ideally the announce delivery path should run through the same TTS pipeline as direct replies.

extent analysis

Fix Plan

To resolve the issue with [[tts]] and [[tts:text]] tags not being processed in cron job announce mode, we need to modify the maybeApplyTtsToPayload function to handle cron job deliveries.

Code Changes

We will update the maybeApplyTtsToPayload function to check for cron job deliveries and apply TTS processing accordingly. Here's an example code snippet:

function maybeApplyTtsToPayload(payload, session) {
  // ... existing code ...

  // Check if the payload is from a cron job delivery
  if (session.delivery && session.delivery.mode === 'announce') {
    // Apply TTS processing for cron job deliveries
    if (payload.text.includes('[[tts]]') || payload.text.includes('[[tts:text]]')) {
      // TTS processing logic here
      const ttsText = payload.text.replace('[[tts]]', '').replace('[[tts:text]]', '');
      const ttsAudio = generateTtsAudio(ttsText); // assuming generateTtsAudio function exists
      payload.audio = ttsAudio;
    }
  }

  // ... existing code ...
}

Configuration Changes

No configuration changes are required. The existing openclaw.json configuration should work with the updated code.

Verification

To verify the fix, create a new cron job with sessionTarget: "isolated" and delivery.mode: "announce", and include [[tts]] or [[tts:text]] tags in the payload message. The delivered message should now include a voice note generated by the TTS pipeline.

Extra Tips

  • Make sure to test the fix with different TTS providers and voice settings to ensure compatibility.
  • Consider adding logging or debugging statements to the maybeApplyTtsToPayload function to monitor TTS processing for cron job deliveries.

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