[PR #1132] [CLOSED] feat(tts): pass model to provider voices endpoint #4938

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1132
Author: @etherious1804
Created: 5/24/2026
Status: ❌ Closed

Base: staging ← Head: feat/tts-voices-pass-model


📝 Commits (1)

  • 5461c08 feat(tts): pass model to provider voices endpoint

📊 Changes

1 file changed (+8 additions, -1 deletions)

View changed files

📝 packages/server/src/routes/tts.routes.ts (+8 -1)

📄 Description

Linked issue

Closes #1131

Why this change

When the TTS source is openai but the baseUrl points at a local or third-party OpenAI-compatible TTS server (mlx-audio, openedai-speech, LocalAI, etc.), Marinara's voice dropdown silently falls back to OpenAI's hardcoded 9 voices instead of showing what the configured server actually supports.

Root cause: fetchProviderVoices already calls ${base}/audio/voices and falls back gracefully on 404 — but it doesn't pass the configured model as a query param. Multi-model OAI-compatible TTS servers can't return the right voice catalog without that hint, so they 400 or return the wrong list, and Marinara falls back to the hardcoded OpenAI nine.

Concrete impact: per-character voice mode (voiceMode: "per-character") is effectively unusable against a local TTS server today — users can only assign characters to the 9 cloud voices Marinara hardcodes for the openai source.

What changed

packages/server/src/routes/tts.routes.ts — 8 lines added in fetchProviderVoices:

  • Build the voices URL with ?model=${cfg.model} when a model is configured.
  • Vanilla api.openai.com ignores unknown query params, so default OpenAI users see zero behavior change.
  • Local/multi-model servers can now disambiguate which model's catalog to return.

No new dependencies. No client changes — the existing voice fetch path picks up the richer list automatically.

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

Verified end-to-end against a local mlx-audio server (Kokoro 82M) at http://127.0.0.1:8081/v1:

  • pnpm check ran cleanly (TS + ESLint + build, exit code 0). The only WARN lines are the pre-existing Unsupported engine notes for node 26 vs >=24 <26 — unrelated to this change.
  • Before the patch: GET /api/tts/voices returned { fromProvider: false, voices: [alloy, ash, coral, echo, fable, nova, onyx, sage, shimmer] } — the OpenAI hardcoded fallback.
  • After the patch: same call returns { fromProvider: true, voices: <54 Kokoro voice ids> } — the 28 English voices (af_*, am_*, bf_*, bm_*) plus the 26 non-English ones (if_*, zf_*, etc.).
  • POST /api/tts/speak with voice: "bm_george" (a voice that wasn't previously visible) returned a valid mp3 and played correctly through afplay.
  • Reviewer should: configure TTS against a real OAI-compatible local TTS server (or set model to a non-existent value against api.openai.com — the request still goes through, OpenAI ignores the extra param). UI dropdown should populate from the provider rather than fall back. Per-character voice assignment should now show the full provider catalog.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No docs need touching — the existing behavior is documented as "Marinara queries the provider for its voice list" and that's still what happens. This makes the existing query actually work for multi-model providers.

UI evidence (if applicable)

No UI code changed. The existing voice picker (packages/client/src/components/panels/settings/TTSConfigCard.tsx) reads from /api/tts/voices and renders whatever it gets — so the dropdown automatically shows the new richer list. No screenshots attached because the visible change is just "more entries in the dropdown."

🤖 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/1132 **Author:** [@etherious1804](https://github.com/etherious1804) **Created:** 5/24/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `feat/tts-voices-pass-model` --- ### 📝 Commits (1) - [`5461c08`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5461c08c8bfe34b9d91dbb76bcb4584380905d68) feat(tts): pass model to provider voices endpoint ### 📊 Changes **1 file changed** (+8 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/tts.routes.ts` (+8 -1) </details> ### 📄 Description <!-- This is an AI-generated PR. Per CLAUDE.md, validation/test-plan checkboxes are intentionally left unchecked. Verification proof for the human reviewer is in prose below. --> ## Linked issue Closes #1131 ## Why this change When the TTS source is `openai` but the `baseUrl` points at a local or third-party OpenAI-compatible TTS server (mlx-audio, openedai-speech, LocalAI, etc.), Marinara's voice dropdown silently falls back to OpenAI's hardcoded 9 voices instead of showing what the configured server actually supports. Root cause: `fetchProviderVoices` already calls `${base}/audio/voices` and falls back gracefully on 404 — but it doesn't pass the configured model as a query param. Multi-model OAI-compatible TTS servers can't return the right voice catalog without that hint, so they 400 or return the wrong list, and Marinara falls back to the hardcoded OpenAI nine. Concrete impact: per-character voice mode (`voiceMode: "per-character"`) is effectively unusable against a local TTS server today — users can only assign characters to the 9 cloud voices Marinara hardcodes for the openai source. ## What changed `packages/server/src/routes/tts.routes.ts` — 8 lines added in `fetchProviderVoices`: - Build the voices URL with `?model=${cfg.model}` when a model is configured. - Vanilla `api.openai.com` ignores unknown query params, so default OpenAI users see zero behavior change. - Local/multi-model servers can now disambiguate which model's catalog to return. No new dependencies. No client changes — the existing voice fetch path picks up the richer list automatically. ## Validation - [x] `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 Verified end-to-end against a local mlx-audio server (Kokoro 82M) at `http://127.0.0.1:8081/v1`: - `pnpm check` ran cleanly (TS + ESLint + build, exit code 0). The only WARN lines are the pre-existing `Unsupported engine` notes for node 26 vs `>=24 <26` — unrelated to this change. - Before the patch: `GET /api/tts/voices` returned `{ fromProvider: false, voices: [alloy, ash, coral, echo, fable, nova, onyx, sage, shimmer] }` — the OpenAI hardcoded fallback. - After the patch: same call returns `{ fromProvider: true, voices: <54 Kokoro voice ids> }` — the 28 English voices (`af_*`, `am_*`, `bf_*`, `bm_*`) plus the 26 non-English ones (`if_*`, `zf_*`, etc.). - `POST /api/tts/speak` with `voice: "bm_george"` (a voice that wasn't previously visible) returned a valid mp3 and played correctly through afplay. - Reviewer should: configure TTS against a real OAI-compatible local TTS server (or set `model` to a non-existent value against api.openai.com — the request still goes through, OpenAI ignores the extra param). UI dropdown should populate from the provider rather than fall back. Per-character voice assignment should now show the full provider catalog. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No docs need touching — the existing behavior is documented as "Marinara queries the provider for its voice list" and that's still what happens. This makes the existing query actually work for multi-model providers. ## UI evidence (if applicable) No UI code changed. The existing voice picker (`packages/client/src/components/panels/settings/TTSConfigCard.tsx`) reads from `/api/tts/voices` and renders whatever it gets — so the dropdown automatically shows the new richer list. No screenshots attached because the visible change is just "more entries in the dropdown." 🤖 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-10-22 04:11:52 +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#4938
No description provided.