openclaw - 💡(How to fix) Fix WebChat TTS: add explicit routing/playback logs and user-visible delivery status [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#57297Fetched 2026-04-08 01:51:23
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Related bug report with repro/environment details: https://github.com/openclaw/openclaw/issues/57296

Error Message

  1. tts.delivery.succeeded or tts.delivery.failed (with reason/error code)

Root Cause

Related bug report with repro/environment details: https://github.com/openclaw/openclaw/issues/57296

RAW_BUFFERClick to expand / collapse

WebChat TTS: add explicit routing/playback logs and user-visible delivery status

Problem

When TTS is triggered from WebChat, operators may see a tool-level success signal but still get no audible output and no downloadable media. Current logs do not clearly show where the WebChat TTS pipeline failed (generation vs routing vs delivery/playback).

Request

Please add explicit structured telemetry (and ideally UI status) for WebChat TTS pipeline stages:

  1. tts.generate.started
  2. tts.generate.succeeded (provider/model/audio metadata)
  3. tts.route.selected (e.g., webchat inline playback, media attachment, local speaker)
  4. tts.delivery.succeeded or tts.delivery.failed (with reason/error code)
  5. Correlation id linking tool invocation to channel delivery events

Why this helps

This makes it straightforward to distinguish:

  • synthesis failures
  • channel routing failures
  • browser playback policy limitations
  • attachment/media delivery failures

Acceptance criteria

  • Each WebChat TTS trigger emits a clear route + outcome event in gateway logs.
  • Failures include actionable reason codes/messages.
  • (Optional but ideal) WebChat UI surfaces final TTS delivery status to the user.

Context

Related bug report with repro/environment details: https://github.com/openclaw/openclaw/issues/57296

extent analysis

Fix Plan

To address the issue, we will implement explicit logging and telemetry for the WebChat TTS pipeline. The fix involves adding structured logs for each stage of the pipeline.

Step-by-Step Solution:

  1. Add logging for TTS generation:
    • Log tts.generate.started when TTS generation is initiated.
    • Log tts.generate.succeeded with provider/model/audio metadata upon successful generation.
  2. Implement routing logging:
    • Log tts.route.selected with the chosen routing method (e.g., webchat inline playback, media attachment, local speaker).
  3. Add delivery logging:
    • Log tts.delivery.succeeded upon successful delivery.
    • Log tts.delivery.failed with reason/error code upon delivery failure.
  4. Correlate events with a unique ID:
    • Use a correlation ID to link tool invocation to channel delivery events.

Example Code (Node.js):

// Assuming a logger function and a correlation ID generator
function logEvent(event, data) {
  console.log(`${event}: ${JSON.stringify(data)}`);
}

function generateTTS(text) {
  const correlationId = generateCorrelationId();
  logEvent('tts.generate.started', { correlationId });
  
  // TTS generation logic here
  const ttsData = generateTTSData(text);
  logEvent('tts.generate.succeeded', { correlationId, ...ttsData });
  
  return ttsData;
}

function routeTTS(ttsData) {
  const correlationId = ttsData.correlationId;
  const routeMethod = selectRouteMethod(); // Logic to select route method
  logEvent('tts.route.selected', { correlationId, routeMethod });
  
  // Routing logic here
  return routeMethod;
}

function deliverTTS(ttsData, routeMethod) {
  const correlationId = ttsData.correlationId;
  try {
    // Delivery logic here
    logEvent('tts.delivery.succeeded', { correlationId });
  } catch (error) {
    logEvent('tts.delivery.failed', { correlationId, reason: error.message });
  }
}

Verification

To verify the fix, check the gateway logs for the added events (tts.generate.started, tts.generate.succeeded, tts.route.selected, tts.delivery.succeeded, tts.delivery.failed) with their respective data. Ensure that each WebChat TTS trigger emits these events and that failures include actionable reason codes/messages.

Extra Tips

  • Ensure proper error handling and logging in each stage of the pipeline.
  • Consider surfacing the final TTS delivery status to the user in the WebChat UI for a better user experience.
  • Regularly review logs to identify and address common failure points in the TTS pipeline.

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 WebChat TTS: add explicit routing/playback logs and user-visible delivery status [1 participants]