[PR #8941] [MERGED] fix(connections): list a local voice server On this device #8897

Closed
opened 2026-11-07 20:43:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8941
Author: @SpicyMarinara
Created: 11/7/2026
Status: ✅ Merged
Merged: 11/7/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/local-tts-connections


📝 Commits (1)

  • cfeacfa fix(connections): list a local voice server On this device (#8921)

📊 Changes

9 files changed (+154 additions, -10 deletions)

View changed files

📝 docs/media/tts-setup.md (+1 -1)
📝 packages/client/src/components/connections/ConnectionDefaults.tsx (+2 -2)
📝 packages/client/src/components/connections/DeviceDetail.tsx (+5 -3)
📝 packages/client/src/components/panels/ConnectionsPanel.tsx (+5 -1)
📝 packages/client/src/hooks/use-tts.ts (+2 -1)
📝 packages/server/src/routes/tts.routes.ts (+13 -2)
📝 packages/shared/src/types/tts.ts (+6 -0)
📝 scripts/regressions/connection-voice-row.regression.ts (+23 -0)
➕ scripts/regressions/tts-local-voice-server.regression.ts (+97 -0)

📄 Description

Linked issue

Closes #8921

Why this change

Local text-to-speech disappeared from Connections after the new Connections UI, so players couldn't find where to change or turn it off. #8922 (Refs #8921) fixed the reporter's case: the Voice row now opens the PocketTTS page under On this device.

One case was still broken. A voice server running on the player's own computer or network, but set up with a source other than PocketTTS, was treated as a cloud voice. That covers Kokoro or Speaches set up as OpenAI-compatible at localhost:8880, a 192.168.x address or host.docker.internal. It had no row under On this device, and its Voice row still opened the empty "No models yet" picker. The cause: since 2bdce9badb (#8678), both places decide "local" by the source name alone (tts.source === "pockettts").

What changed

  • Server (packages/server/src/routes/tts.routes.ts): ttsRunsLocally(cfg) is true for PocketTTS or for any configured base URL the server's existing isLocalInferenceBaseUrl counts as local. That is the same rule the model catalog uses for chat connections: loopback, private ranges, .local, .internal, host.docker.internal, Tailscale 100.x, fd00::/fe80:: and single-label hosts. GET /api/tts/config returns it as local, never saved back, from the effective settings, including when an Audio connection is chosen. The shared type TTSConfigResponse describes it.
  • Client:
    • DeviceDetail.tsx and ConnectionDefaults.tsx use tts.local. A local server gets its On this device row, labelled by its host (for example "localhost:8880") rather than "OpenAI", and the Voice row opens that page.
    • ConnectionsPanel.tsx keeps the TTS page open while text to speech is on. The card saves the Base URL as you type, and a half-typed address used to close the page.
  • docs/media/tts-setup.md: the card is also under On this device for PocketTTS or another voice server on your computer or private network.
  • Marinara doesn't start or load TTS servers, so there is nothing to unload when two are running. The card holds one source at a time.

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

Manual verification notes

Run by the agent (not a substitute for the boxes above):

  • pnpm check: exit 0.
  • New tts-local-voice-server.regression.ts:
    • the rule against loopback, private, .local, .internal, Docker, Tailscale, IPv6 and single-label hosts versus cloud and malformed URLs;
    • the route returns local, and saving what was read back doesn't store it.
  • Extended connection-voice-row.regression.ts: the page stays open while typing, and the host label.
  • --filter tts (14/14) and --filter connection (36/36): pass.

Still to verify by hand:

  • Manually verify in Connections, on desktop and at phone width, that with Kokoro at http://localhost:8880/v1 the On this device row reads "Text to speech · localhost:8880" and opens its page.
  • Manually verify that typing a new Base URL slowly on that page keeps it open.
  • Manually verify that a cloud OpenAI voice is still not listed under On this device.

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)

🤖 Generated with Claude Code


🔄 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/8941 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/7/2026 **Status:** ✅ Merged **Merged:** 11/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/local-tts-connections` --- ### 📝 Commits (1) - [`cfeacfa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cfeacfa6420e34cabf20e9a2eaa4c354140698cc) fix(connections): list a local voice server On this device (#8921) ### 📊 Changes **9 files changed** (+154 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `docs/media/tts-setup.md` (+1 -1) 📝 `packages/client/src/components/connections/ConnectionDefaults.tsx` (+2 -2) 📝 `packages/client/src/components/connections/DeviceDetail.tsx` (+5 -3) 📝 `packages/client/src/components/panels/ConnectionsPanel.tsx` (+5 -1) 📝 `packages/client/src/hooks/use-tts.ts` (+2 -1) 📝 `packages/server/src/routes/tts.routes.ts` (+13 -2) 📝 `packages/shared/src/types/tts.ts` (+6 -0) 📝 `scripts/regressions/connection-voice-row.regression.ts` (+23 -0) ➕ `scripts/regressions/tts-local-voice-server.regression.ts` (+97 -0) </details> ### 📄 Description ## Linked issue Closes #8921 ## Why this change Local text-to-speech disappeared from Connections after the new Connections UI, so players couldn't find where to change or turn it off. #8922 (Refs #8921) fixed the reporter's case: the **Voice** row now opens the PocketTTS page under **On this device**. One case was still broken. A voice server running on the player's own computer or network, but set up with a source other than PocketTTS, was treated as a cloud voice. That covers Kokoro or Speaches set up as **OpenAI-compatible** at `localhost:8880`, a `192.168.x` address or `host.docker.internal`. It had no row under **On this device**, and its **Voice** row still opened the empty "No models yet" picker. The cause: since 2bdce9badb (#8678), both places decide "local" by the source name alone (`tts.source === "pockettts"`). ## What changed - **Server** (`packages/server/src/routes/tts.routes.ts`): `ttsRunsLocally(cfg)` is true for PocketTTS or for any configured base URL the server's existing `isLocalInferenceBaseUrl` counts as local. That is the same rule the model catalog uses for chat connections: loopback, private ranges, `.local`, `.internal`, `host.docker.internal`, Tailscale `100.x`, `fd00::`/`fe80::` and single-label hosts. `GET /api/tts/config` returns it as `local`, never saved back, from the effective settings, including when an Audio connection is chosen. The shared type `TTSConfigResponse` describes it. - **Client:** - `DeviceDetail.tsx` and `ConnectionDefaults.tsx` use `tts.local`. A local server gets its **On this device** row, labelled by its host (for example "localhost:8880") rather than "OpenAI", and the **Voice** row opens that page. - `ConnectionsPanel.tsx` keeps the TTS page open while text to speech is on. The card saves the Base URL as you type, and a half-typed address used to close the page. - `docs/media/tts-setup.md`: the card is also under **On this device** for PocketTTS or another voice server on your computer or private network. - Marinara doesn't start or load TTS servers, so there is nothing to unload when two are running. The card holds one source at a time. ## 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` ### Manual verification notes Run by the agent (not a substitute for the boxes above): - `pnpm check`: exit 0. - New `tts-local-voice-server.regression.ts`: - the rule against loopback, private, `.local`, `.internal`, Docker, Tailscale, IPv6 and single-label hosts versus cloud and malformed URLs; - the route returns `local`, and saving what was read back doesn't store it. - Extended `connection-voice-row.regression.ts`: the page stays open while typing, and the host label. - `--filter tts` (14/14) and `--filter connection` (36/36): pass. Still to verify by hand: - Manually verify in Connections, on desktop and at phone width, that with Kokoro at `http://localhost:8880/v1` the **On this device** row reads "Text to speech · localhost:8880" and opens its page. - Manually verify that typing a new Base URL slowly on that page keeps it open. - Manually verify that a cloud OpenAI voice is still not listed under **On this device**. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed - [x] 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) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 20:43:05 +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#8897
No description provided.