[PR #1990] [MERGED] Fix configurable TTS request timeout #5377

Closed
opened 2026-10-22 04:15:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1990
Author: @cha1latte
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1987-tts-timeout


📝 Commits (1)

  • 2414f59 Fix configurable TTS request timeout

📊 Changes

4 files changed (+76 additions, -2 deletions)

View changed files

📝 src-tauri/src/commands/storage/integrations/tts.rs (+39 -1)
📝 src/engine/contracts/types/tts.ts (+2 -0)
📝 src/features/shell/discovery/discovery-entries.json (+1 -1)
📝 src/features/shell/settings/components/settings/TTSConfigCard.tsx (+34 -0)

📄 Description

Linked issue

Closes #1987

Why this change

  • Self-hosted OpenAI-compatible TTS providers can need more than 60 seconds to synthesize one chunk. Refactor still hard-coded the TTS speak provider timeout at 60 seconds, so slow local voice models could time out even though chunking was working.

What changed

  • Added requestTimeoutMs to the persisted TTS config with a legacy-compatible 60000 ms default and 1000-1800000 ms bounds.
  • Changed the Rust TTS speak provider client to use the configured timeout instead of Duration::from_secs(60).
  • Added Rust regression coverage for default, configured, and clamped timeout values.
  • Added an autosaved Request Timeout control to the existing TTS settings card.
  • Updated the existing Text-to-Speech discovery entry with timeout/self-hosted search terms.

Refactor impact

Primary owner:

Rust storage

Impact areas reviewed:

  • TTS Rust integration command path
  • TTS config TypeScript schema
  • TTS settings card autosave path
  • Shell discovery metadata

Boundary notes:

  • Feature UI continues to use the existing shared TTS API/config hooks.
  • Engine contract only adds the config field; no React imports or runtime adapter imports were added to engine code.
  • Rust storage remains the privileged owner for provider request execution.

Pressure points touched:

  • src-tauri/src/commands/storage/integrations/tts.rs
  • src/features/shell/settings/components/settings/TTSConfigCard.tsx
  • No command registration, mode surface, import, or prompt pipeline changes.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex proof recorded locally in scratch/bugfix-verification.json.
  • Before proof: powershell -NoProfile -ExecutionPolicy Bypass -File scratch\issue-1987-tts-timeout-repro.ps1 reported the hard-coded 60s timeout and missing config field.
  • After proof: the same repro reported the TTS speak timeout is configurable through the app-owned config/schema path.
  • cargo test --manifest-path src-tauri\Cargo.toml tts_request_timeout -- --nocapture passed: 3 passed, 0 failed.
  • pnpm typecheck passed.
  • cargo check --manifest-path src-tauri\Cargo.toml passed.
  • pnpm check:discovery passed.
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed.
  • Final pnpm check passed.
  • Manual/browser note: no browser screenshot was captured; core claim is covered by command proof, and the new settings control should still be visually smoke-tested by a human if desired.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Updated the existing Text-to-Speech discovery entry with timeout and self-hosted TTS search terms.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

Backend/settings-contract fix; no screenshot captured. The visible UI addition is one numeric Request Timeout control in the existing TTS settings card.

Summary by CodeRabbit

Release Notes

  • New Features
    • Text-to-Speech request timeout is now configurable. Adjust the timeout duration in TTS settings (default: 60 seconds, range: 1–1,800 seconds).

🔄 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/1990 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1987-tts-timeout` --- ### 📝 Commits (1) - [`2414f59`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2414f59edebfa8a5c48eeef3fe39b7195f60fc77) Fix configurable TTS request timeout ### 📊 Changes **4 files changed** (+76 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/integrations/tts.rs` (+39 -1) 📝 `src/engine/contracts/types/tts.ts` (+2 -0) 📝 `src/features/shell/discovery/discovery-entries.json` (+1 -1) 📝 `src/features/shell/settings/components/settings/TTSConfigCard.tsx` (+34 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue <!-- Every user-facing PR should reference a feature request or issue report when practical. --> Closes #1987 ## Why this change <!-- What user problem, bug, refactor goal, or maintenance need does this solve? --> - Self-hosted OpenAI-compatible TTS providers can need more than 60 seconds to synthesize one chunk. Refactor still hard-coded the TTS speak provider timeout at 60 seconds, so slow local voice models could time out even though chunking was working. ## What changed <!-- List the key changes in this PR. --> - Added `requestTimeoutMs` to the persisted TTS config with a legacy-compatible 60000 ms default and 1000-1800000 ms bounds. - Changed the Rust TTS `speak` provider client to use the configured timeout instead of `Duration::from_secs(60)`. - Added Rust regression coverage for default, configured, and clamped timeout values. - Added an autosaved Request Timeout control to the existing TTS settings card. - Updated the existing Text-to-Speech discovery entry with timeout/self-hosted search terms. ## Refactor impact Primary owner: <!-- Examples: app shell, catalog, chat mode, roleplay mode, game mode, runtime generation, world-state, shared API, engine generation, Rust storage, imports, remote runtime. --> Rust storage Impact areas reviewed: - TTS Rust integration command path - TTS config TypeScript schema - TTS settings card autosave path - Shell discovery metadata Boundary notes: <!-- Note engine/shared-api/feature/Rust/remote-runtime boundaries. Say "none" only if you checked. --> - Feature UI continues to use the existing shared TTS API/config hooks. - Engine contract only adds the config field; no React imports or runtime adapter imports were added to engine code. - Rust storage remains the privileged owner for provider request execution. Pressure points touched: <!-- Mention ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules if touched. --> - `src-tauri/src/commands/storage/integrations/tts.rs` - `src/features/shell/settings/components/settings/TTSConfigCard.tsx` - No command registration, mode surface, import, or prompt pipeline changes. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes <!-- Describe exact commands and manual steps, including typecheck/build/docs/architecture/Rust/browser/remote-runtime checks when they apply. If an AI agent filled this out, verify it yourself before ticking boxes. --> - Codex proof recorded locally in `scratch/bugfix-verification.json`. - Before proof: `powershell -NoProfile -ExecutionPolicy Bypass -File scratch\issue-1987-tts-timeout-repro.ps1` reported the hard-coded 60s timeout and missing config field. - After proof: the same repro reported the TTS speak timeout is configurable through the app-owned config/schema path. - `cargo test --manifest-path src-tauri\Cargo.toml tts_request_timeout -- --nocapture` passed: 3 passed, 0 failed. - `pnpm typecheck` passed. - `cargo check --manifest-path src-tauri\Cargo.toml` passed. - `pnpm check:discovery` passed. - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed. - Final `pnpm check` passed. - Manual/browser note: no browser screenshot was captured; core claim is covered by command proof, and the new settings control should still be visually smoke-tested by a human if desired. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Updated the existing Text-to-Speech discovery entry with timeout and self-hosted TTS search terms. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence <!-- Add before/after screenshots or recordings for visible UI changes. --> Backend/settings-contract fix; no screenshot captured. The visible UI addition is one numeric Request Timeout control in the existing TTS settings card. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Text-to-Speech request timeout is now configurable. Adjust the timeout duration in TTS settings (default: 60 seconds, range: 1–1,800 seconds). <!-- 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-22 04:15:46 +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#5377
No description provided.