[PR #7723] [MERGED] fix(tts): let a slow voice server have more time #7898

Closed
opened 2026-10-24 04:08:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7723
Author: @SpicyMarinara
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/7711-tts-timeout


📝 Commits (3)

  • 7a12b79 fix(tts): let a slow voice server have more time
  • 95f7923 fix(tts): put the connection's timeout label above its field, and word the card's scope as speech
  • f74be2b fix(tts): let a Request timeout above 300 s actually wait that long

📊 Changes

18 files changed (+414 additions, -13 deletions)

View changed files

📝 docs/TROUBLESHOOTING.md (+1 -0)
📝 docs/connections/providers-reference.md (+1 -1)
📝 docs/media/tts-setup.md (+9 -0)
➕ e2e/tts-request-timeout.e2e.ts (+89 -0)
📝 packages/client/src/components/connections/ConnectionEditor.tsx (+30 -0)
📝 packages/client/src/components/panels/settings/TTSConfigCard.tsx (+19 -0)
📝 packages/client/src/hooks/use-connections.ts (+1 -0)
📝 packages/client/src/lib/connection-transfer.ts (+12 -5)
📝 packages/client/src/lib/tts-service.ts (+8 -0)
📝 packages/client/src/localization/locales/en.json (+4 -0)
📝 packages/server/src/db/schema/connections.ts (+2 -0)
📝 packages/server/src/routes/tts.routes.ts (+23 -5)
📝 packages/server/src/services/storage/connections.storage.ts (+3 -0)
📝 packages/shared/src/schemas/connection.schema.ts (+9 -0)
📝 packages/shared/src/types/connection.ts (+2 -0)
📝 packages/shared/src/types/tts.ts (+15 -0)
📝 scripts/regressions/tsconfig.client-lanes.json (+6 -2)
➕ scripts/regressions/tts-request-timeout.regression.ts (+180 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7711

Why this change

  • A user running Breeze TTS on a laptop got a TTS timeout on longer lines and found no way to wait longer. Every speech request (POST /api/tts/speak) gave up after a hard-coded 60 seconds. Image, video and agent calls already have timeouts in the app; speech had none.
  • A local voice server can be fast enough to use and still need more than 60 s for one long line. The fix lets the user give it that time from the Engine UI, without any .env setting.
  • When it does time out, the old message ("TTS request timed out") did not say what to do about it.

What changed

  • Text to Speech card: new Request timeout (seconds) field below Model, 10 to 3,600 s, starting at 60 s. Saved in the TTS settings as requestTimeoutMs. Settings saved before this change read as 60 s.
  • Audio connections: the same field in the connection editor, below Default Voice. Stored per connection as audioTimeoutMs (null means the 60 s default, as with the Decision time limit). It is carried through connection export/import and duplication.
  • Server: /api/tts/speak uses the limit of whatever it speaks through. That is the connection's own limit for an audio connection, or the card's for the card's settings and its Preview. The card's value never applies to a connection, so each limit is set next to the server it is for.
  • Timeout message: the response now carries code: "tts_timeout", the seconds waited and the connection name. The client shows "No audio after 60 s. To wait longer, raise Request timeout in Connections > Text to Speech." or "...in the audio connection." The server log line names the same setting. The error text is unchanged.
  • Docs: docs/media/tts-setup.md (new "Request timeout" section and a troubleshooting bullet), docs/TROUBLESHOOTING.md (Voice, calls, and TTS), docs/connections/providers-reference.md (Audio).
  • Proof: scripts/regressions/tts-request-timeout.regression.ts runs the real route against a loopback voice server that answers after 800 ms, with timers scaled 200 times faster. With the old fixed AbortSignal.timeout(60_000) restored it fails (actual: [60000], expected: [300000]). It also fails without the client mapping, because the message stays "TTS request timed out". e2e/tts-request-timeout.e2e.ts saves the field on the card and on an audio connection, then checks both after a reload.

Out of scope: in chats, a failed Speak or auto-play is silent today, with no toast. The new message shows wherever TTS errors already appear: the card's Preview, the character voice preview, and the server log.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run checks (not a substitute for the boxes above): tsc --noEmit for shared, server, client and root; ESLint on the changed client files; Prettier on the changed files; node scripts/check-locales.mjs and pnpm localization:check. The new regression and the existing TTS/connection regressions also passed: tts-pcm, tts-source-persistence, tts-voice-assignment-route, tts-cache-clear, tts-safari-play-guard, avatar-tts-lipsync, roleplay-vn-tts, speech-to-text-server, decision-connection-time-limit, decision-chat-connection, connection-model-list, connection-test-parameters, agent-connection-parameters, default-embedding-connection, game-satellite-connection-parameters and profile-import-data-security.

Manual verification notes

  • Manually verify that Connections > Text to Speech shows Request timeout (seconds) below Model with 60, that changing it saves, and that it survives a reload.
  • Manually verify that an Audio connection's editor shows Request timeout (seconds) below Default Voice with 60, and that a changed value saves with Save and survives a reload.
  • Manually verify with a slow local voice server (or a tiny limit against one) that a timeout in the card's Preview shows "No audio after N s. To wait longer, raise Request timeout in Connections > Text to Speech."
  • Manually verify that a chat Speak through an audio connection with a raised limit now finishes a line that used to stop at 60 s.
  • Manually verify both fields in light and dark mode and at mobile width.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Docs changed under docs/: docs/media/tts-setup.md, docs/TROUBLESHOOTING.md, docs/connections/providers-reference.md. The [docs-i18n] follow-up is linked in a comment below.

UI evidence (if applicable)

The e2e spec attaches screenshots of both fields (tts-card-request-timeout, audio-connection-request-timeout) to its Playwright report.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Set a request timeout for text-to-speech and audio connections, from 10 seconds to 1 hour. The default is 60 seconds.
    • Timeout errors show how long the request waited and whether to adjust the text-to-speech or connection setting.
  • Documentation
    • Updated setup and troubleshooting guides with timeout settings and steps for resolving “No audio after 60 s” errors.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7723 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/7711-tts-timeout` --- ### 📝 Commits (3) - [`7a12b79`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7a12b79a928be351230b07d3b89ab762af1f3dea) fix(tts): let a slow voice server have more time - [`95f7923`](https://github.com/Pasta-Devs/Marinara-Engine/commit/95f792308c6fd31a4d0ba33d61236ca590a6d2bc) fix(tts): put the connection's timeout label above its field, and word the card's scope as speech - [`f74be2b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f74be2b7a00be23fe693b752e1c49209d486a57e) fix(tts): let a Request timeout above 300 s actually wait that long ### 📊 Changes **18 files changed** (+414 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `docs/TROUBLESHOOTING.md` (+1 -0) 📝 `docs/connections/providers-reference.md` (+1 -1) 📝 `docs/media/tts-setup.md` (+9 -0) ➕ `e2e/tts-request-timeout.e2e.ts` (+89 -0) 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+30 -0) 📝 `packages/client/src/components/panels/settings/TTSConfigCard.tsx` (+19 -0) 📝 `packages/client/src/hooks/use-connections.ts` (+1 -0) 📝 `packages/client/src/lib/connection-transfer.ts` (+12 -5) 📝 `packages/client/src/lib/tts-service.ts` (+8 -0) 📝 `packages/client/src/localization/locales/en.json` (+4 -0) 📝 `packages/server/src/db/schema/connections.ts` (+2 -0) 📝 `packages/server/src/routes/tts.routes.ts` (+23 -5) 📝 `packages/server/src/services/storage/connections.storage.ts` (+3 -0) 📝 `packages/shared/src/schemas/connection.schema.ts` (+9 -0) 📝 `packages/shared/src/types/connection.ts` (+2 -0) 📝 `packages/shared/src/types/tts.ts` (+15 -0) 📝 `scripts/regressions/tsconfig.client-lanes.json` (+6 -2) ➕ `scripts/regressions/tts-request-timeout.regression.ts` (+180 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7711 ## Why this change - A user running Breeze TTS on a laptop got a TTS timeout on longer lines and found no way to wait longer. Every speech request (`POST /api/tts/speak`) gave up after a hard-coded 60 seconds. Image, video and agent calls already have timeouts in the app; speech had none. - A local voice server can be fast enough to use and still need more than 60 s for one long line. The fix lets the user give it that time from the Engine UI, without any `.env` setting. - When it does time out, the old message ("TTS request timed out") did not say what to do about it. ## What changed - **Text to Speech card:** new **Request timeout (seconds)** field below **Model**, 10 to 3,600 s, starting at 60 s. Saved in the TTS settings as `requestTimeoutMs`. Settings saved before this change read as 60 s. - **Audio connections:** the same field in the connection editor, below **Default Voice**. Stored per connection as `audioTimeoutMs` (null means the 60 s default, as with the Decision time limit). It is carried through connection export/import and duplication. - **Server:** `/api/tts/speak` uses the limit of whatever it speaks through. That is the connection's own limit for an audio connection, or the card's for the card's settings and its Preview. The card's value never applies to a connection, so each limit is set next to the server it is for. - **Timeout message:** the response now carries `code: "tts_timeout"`, the seconds waited and the connection name. The client shows "No audio after 60 s. To wait longer, raise Request timeout in Connections > Text to Speech." or "...in the <name> audio connection." The server log line names the same setting. The `error` text is unchanged. - **Docs:** `docs/media/tts-setup.md` (new "Request timeout" section and a troubleshooting bullet), `docs/TROUBLESHOOTING.md` (Voice, calls, and TTS), `docs/connections/providers-reference.md` (Audio). - **Proof:** `scripts/regressions/tts-request-timeout.regression.ts` runs the real route against a loopback voice server that answers after 800 ms, with timers scaled 200 times faster. With the old fixed `AbortSignal.timeout(60_000)` restored it fails (`actual: [60000], expected: [300000]`). It also fails without the client mapping, because the message stays "TTS request timed out". `e2e/tts-request-timeout.e2e.ts` saves the field on the card and on an audio connection, then checks both after a reload. Out of scope: in chats, a failed Speak or auto-play is silent today, with no toast. The new message shows wherever TTS errors already appear: the card's Preview, the character voice preview, and the server log. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run checks (not a substitute for the boxes above): `tsc --noEmit` for shared, server, client and root; ESLint on the changed client files; Prettier on the changed files; `node scripts/check-locales.mjs` and `pnpm localization:check`. The new regression and the existing TTS/connection regressions also passed: tts-pcm, tts-source-persistence, tts-voice-assignment-route, tts-cache-clear, tts-safari-play-guard, avatar-tts-lipsync, roleplay-vn-tts, speech-to-text-server, decision-connection-time-limit, decision-chat-connection, connection-model-list, connection-test-parameters, agent-connection-parameters, default-embedding-connection, game-satellite-connection-parameters and profile-import-data-security. ### Manual verification notes - Manually verify that **Connections > Text to Speech** shows **Request timeout (seconds)** below **Model** with 60, that changing it saves, and that it survives a reload. - Manually verify that an **Audio** connection's editor shows **Request timeout (seconds)** below **Default Voice** with 60, and that a changed value saves with **Save** and survives a reload. - Manually verify with a slow local voice server (or a tiny limit against one) that a timeout in the card's **Preview** shows "No audio after N s. To wait longer, raise Request timeout in Connections > Text to Speech." - Manually verify that a chat Speak through an audio connection with a raised limit now finishes a line that used to stop at 60 s. - Manually verify both fields in light and dark mode and at mobile width. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Docs changed under `docs/`: `docs/media/tts-setup.md`, `docs/TROUBLESHOOTING.md`, `docs/connections/providers-reference.md`. The `[docs-i18n]` follow-up is linked in a comment below. ## UI evidence (if applicable) The e2e spec attaches screenshots of both fields (`tts-card-request-timeout`, `audio-connection-request-timeout`) to its Playwright report. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Set a request timeout for text-to-speech and audio connections, from 10 seconds to 1 hour. The default is 60 seconds. * Timeout errors show how long the request waited and whether to adjust the text-to-speech or connection setting. * **Documentation** * Updated setup and troubleshooting guides with timeout settings and steps for resolving “No audio after 60 s” errors. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:08:38 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7898
No description provided.