fix(tts): add error handling for accumulated block TTS

This commit is contained in:
Glucksberg 2026-01-25 19:52:56 +00:00 committed by Shadow
parent 938a9ab627
commit 145618d625
No known key found for this signature in database

View File

@ -346,6 +346,7 @@ export async function dispatchReplyFromConfig(params: {
// This handles the case where block streaming succeeds and drops final payloads, // This handles the case where block streaming succeeds and drops final payloads,
// but we still want TTS audio to be generated from the accumulated block content. // but we still want TTS audio to be generated from the accumulated block content.
if (replies.length === 0 && blockCount > 0 && accumulatedBlockText.trim()) { if (replies.length === 0 && blockCount > 0 && accumulatedBlockText.trim()) {
try {
const ttsSyntheticReply = await maybeApplyTtsToPayload({ const ttsSyntheticReply = await maybeApplyTtsToPayload({
payload: { text: accumulatedBlockText }, payload: { text: accumulatedBlockText },
cfg, cfg,
@ -383,6 +384,11 @@ export async function dispatchReplyFromConfig(params: {
queuedFinal = didQueue || queuedFinal; queuedFinal = didQueue || queuedFinal;
} }
} }
} catch (err) {
logVerbose(
`dispatch-from-config: accumulated block TTS failed: ${err instanceof Error ? err.message : String(err)}`,
);
}
} }
await dispatcher.waitForIdle(); await dispatcher.waitForIdle();