Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Glucksberg
Copy link
Contributor

@Glucksberg Glucksberg commented Jan 25, 2026

This PR fixes TTS (Text-to-Speech) functionality when block streaming is enabled.

Root Cause: When shouldDropFinalPayloads = true (block streaming mode), final replies were being dropped before TTS
processing could occur, resulting in silent responses.

Solution: Accumulate streamed block text during delivery, then generate TTS from the accumulated content after streaming
completes.

Issues Fixed

TTS with Block Streaming

  • TTS now works correctly when block streaming is enabled
  • Accumulated block text is processed for TTS after all blocks are delivered
  • Added error handling for accumulated block TTS generation failures

Help Text Corrections

  • Fixed /tts help to show correct default provider ("edge" not "openai")
  • Updated character limit documentation to show 4096 (actual limit) instead of 280

Truncation Behavior

  • /tts summary now correctly truncates at 4096 characters (was showing 280 in help)
  • Long messages are truncated with "..." suffix before TTS generation

Technical Changes

  • dispatch-from-config.ts: Block text accumulation and synthetic TTS generation with error handling
  • tts.ts: Corrected help text and default provider documentation

Test Plan

  • TypeScript build passes
  • /tts on enables TTS, /tts off disables
  • /tts status shows current TTS configuration
  • /tts help shows correct default provider (edge) and limit (4096)
  • TTS works with block streaming enabled
  • Long messages are truncated correctly before TTS

@Glucksberg
Copy link
Contributor Author

Not finished yet. I'm working on it.

@Glucksberg
Copy link
Contributor Author

Update: TTS Outbound Fixes Added

This PR has been expanded to fix multiple TTS issues that were affecting the system:

Issues Fixed

  1. TTS not generating audio with block streaming (root cause)

    • When block streaming is enabled, final replies are dropped (shouldDropFinalPayloads = true)
    • TTS was only applied to final replies, so no audio was generated
    • Fix: Accumulate block text during streaming and generate TTS-only audio after streaming completes
  2. Inline menu not working (original PR scope)

    • PR feat: Add Line plugin #1630 (LINE plugin) accidentally removed the args and argsMenu definition
    • Fix: Restored detailed command definition with choices
  3. Text truncation behavior

    • When summarization is OFF and text exceeds limit, TTS was skipped entirely
    • Fix: Now truncates text instead of skipping, so audio is always generated
  4. TTS limits aligned with Telegram

    • Changed max limit from 10,000 to 4,096 (Telegram's message limit)
    • Updated help text to reflect this
  5. Improved help messages

    • /tts help now shows comprehensive documentation
    • Each subcommand (limit, summary, audio) shows examples when called without args

Context

The TTS outbound feature stopped working properly when it was moved to core in PR #1559. The combination of block streaming (enabled by default on many channels) and the TTS mode defaulting to "final" meant no audio was being generated for regular messages.

Commits

  • fb29569e9 - fix(tts): restore inline menu args removed by LINE plugin PR
  • 0bc01178e - fix(tts): generate audio when block streaming drops final reply
  • 38ec46a69 - fix(tts): add error handling for accumulated block TTS

Testing

  • ✅ All 4590 tests pass
  • ✅ Manual: TTS audio now generates correctly on Telegram with block streaming
  • ✅ Manual: Inline menu works
  • ✅ Lint and build pass

@Glucksberg Glucksberg force-pushed the fix/tts-inline-menu-regression branch from fb29569 to 38ec46a Compare January 25, 2026 19:53
@Glucksberg Glucksberg changed the title fix(tts): restore inline menu args removed by LINE plugin PR fix(tts): fix outbound TTS and restore inline menu Jan 25, 2026
@Glucksberg
Copy link
Contributor Author

All done and working. hope u like

@Glucksberg
Copy link
Contributor Author

Update: Descriptive Inline Menu

Added descriptive inline menu for /tts command:

Menu title now lists each action with description:

TTS Actions:
• On – Enable TTS for responses
• Off – Disable TTS
• Status – Show current settings
• Provider – Set voice provider (edge, elevenlabs, openai)
• Limit – Set max characters for TTS
• Summary – Toggle AI summary for long texts
• Audio – Generate TTS from custom text
• Help – Show usage guide

Technical changes:

  • Added CommandArgChoice type supporting string | { value, label }
  • Added ResolvedCommandArgChoice for normalized choice handling
  • Updated Telegram, Discord, and Slack handlers to use choice.value for callbacks and choice.label for display
  • Button labels are now capitalized (On, Off, Status, etc.)

PR openclaw#1630 (LINE plugin) accidentally removed the detailed TTS command
definition with args and argsMenu, replacing it with a simplified
version. This restores the original functionality from PR openclaw#1559.

Fixes regression where /tts no longer showed the inline action menu
on Telegram and other native command surfaces.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@Glucksberg Glucksberg force-pushed the fix/tts-inline-menu-regression branch from 38ec46a to 35f1c6b Compare January 28, 2026 15:52
@obviyus
Copy link
Contributor

obviyus commented Jan 29, 2026

Thanks! I’m blocked on review because PR body doesn’t match diff.

Blockers / important:

  1. PR description claims TTS streaming fix + help text + truncation, but diff only changes command registry. Please add missing commits or update the PR summary to reflect actual change.
  2. Removing command categories likely collapses /commands grouping into “Tools” default. If intentional, update grouping logic/docs; if not, restore categories. (src/auto-reply/commands-registry.data.ts, src/auto-reply/status.ts)
  3. /tts inline menu title now defaults to “Choose on | off | …” since argsMenu is auto + description changed. UX regression? Consider keeping prior argsMenu title or shorter description. (src/auto-reply/commands-registry.data.ts, src/auto-reply/commands-registry.ts)
  4. “Restart Clawdbot” naming vs Moltbot guidance—confirm intent. (src/auto-reply/commands-registry.data.ts)

Once PR summary + intent clarified, happy to re-review.

@obviyus
Copy link
Contributor

obviyus commented Jan 29, 2026

Closing per review; re-open once PR summary + scope corrected.

@obviyus obviyus closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants