mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2949] [Issue]: TTS speakSequence uses Promise.all — single chunk failure discards all audio, and nothing plays until the entire batch is fetched #1526
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1526
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kevin-ho on GitHub (Jun 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2949
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The client-side TTS
speakSequencemethod fetches all audio chunks for a message in parallel usingPromise.all, then plays them sequentially. When used with self-hosted TTS backends that process requests sequentially (single GPU, no batching), concurrent requests queue up and later ones can exceed the request timeout. BecausePromise.allrejects on the first failure, all successfully generated audio is discarded and nothing plays at all — not even the chunks that completed successfully.Expected behavior
Actual behavior
Promise.all(packages/client/src/lib/tts-service.ts, line 234).playNext()callback, which runs afterPromise.allresolves.Promise.allrejects, the catch block sets state to"error", and all successfully fetched audio blobs are discarded. The user hears nothing.threading.RLock). Later requests in the queue wait for all earlier ones to finish, and can exceed the 60s provider timeout even though each individual synthesis takes only a few seconds.Steps to reproduce
main), one or more chunks abort.Promise.allrejects. No audio plays at all — including chunks that the server successfully generated and returned.Environment
Logs, screenshots, or video
Server-side (TTS provider) logs — 6 requests arrive simultaneously, serialize at model lock, last one aborts:
Marinara server logs:
Additional context
packages/client/src/lib/tts-service.ts,speakSequence()method (line 234):Promise.allwaits for all requests before callingplayNext(). The comment on lines 205–207 explains this is intentional ("keeps multi-speaker dialogue from starting until the whole spoken queue is ready"), but this design assumes cloud TTS providers where parallel requests return in milliseconds.Promise.allrejects on first failure, discarding all successful audio.Promise.allSettled()would allow skipping failed chunks and playing the rest.Suggested fix — Progressive Playback toggle:
Add a "Progressive Playback" checkbox to the TTS settings card. When enabled:
Promise.allSettled()semantics so a failed chunk is skipped instead of aborting the entire sequence.When disabled (default): current behavior is preserved for users who prefer gap-free multi-speaker dialogue on cloud TTS providers.
This gives users with local/self-hosted TTS backends a way to get reliable playback without modifying timeouts, while keeping the existing batch-then-play behavior as the default for cloud TTS users.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jun 28, 2026):
Fixed on staging: TTS sequencing now keeps successful chunks when others fail, and a saved Progressive Playback option fetches one chunk ahead while playing for local/self-hosted TTS backends.