Skip to content

fix(tts): collect all provider errors instead of only the last - #17964

Merged
steipete merged 1 commit into
openclaw:mainfrom
ikari-pl:fix/tts-collect-all-provider-errors
Feb 16, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
ikari-pl:fix/tts-collect-all-provider-errors

Conversation

@ikari-pl

@ikari-pl ikari-pl commented Feb 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • When TTS conversion fails across multiple providers, the error message now includes all provider failures instead of only the last one
  • Previously, lastError was overwritten by each failing provider, so the final error message could be misleading (e.g. showing edge: disabled when the real issue was an ElevenLabs timeout)
  • Changed lastError: string to errors: string[] in both textToSpeech and textToSpeechTelephony

Test plan

  • pnpm build passes
  • All 40 tests pass (pnpm test)
  • Verify error messages in logs when multiple TTS providers fail

Greptile Summary

Changed error collection from lastError: string to errors: string[] in both textToSpeech and textToSpeechTelephony functions. When multiple TTS providers fail, the error message now includes all provider failures joined with "; " instead of only showing the last one. This prevents misleading error messages (e.g., showing "edge: disabled" when the real issue was an ElevenLabs timeout).

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is straightforward, well-tested (all 40 tests pass), and improves error reporting without changing core logic. Error messages are now consistently formatted as ${provider}: <description>, and the implementation correctly accumulates and joins all provider errors
  • No files require special attention

Last reviewed commit: 9e4576d

(4/5) You can add custom instructions or style guidelines for the agent here!

When TTS conversion fails, the error message now includes failures
from every provider in the fallback chain instead of only the last
one tried. Previously, a timeout on the primary provider (e.g.
ElevenLabs) would be masked by the final fallback's error (e.g.
"edge: disabled"), making it impossible to diagnose the real issue.

Before: "TTS conversion failed: edge: disabled"
After:  "TTS conversion failed: elevenlabs: timeout (30004ms); openai: no API key; edge: disabled"
@steipete
steipete merged commit 84383b5 into openclaw:main Feb 16, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants