mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2756] [Issue]: TTS provider request building — no speed clamp, ignored WAV format, missing model-family gates #1396
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#1396
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 @kolacheee on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2756
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The TTS proxy builds provider request bodies with several gaps around speed clamping, audio format, and per-model/per-provider gating. The user-impacting one is that an ElevenLabs speed outside 0.7-1.2 produces a silent no-audio 502; the rest are inconsistency/diagnostic defects.
Sub-bug 1: ElevenLabs speed out-of-range -> no audio (#1) [primary]
voice_settings: { stability, speed: cfg.speed }(657-660) with no clamp. ElevenLabs accepts speed only in [0.7,1.2] -> 422 -> mapped to 502 'TTS provider returned 422'. The schema allows 0.25-4.0 (tts.ts:112) and the UI Speed slider (TTSConfigCard.tsx:1134-1153) is ungated, advertising the full range to ElevenLabs users.Sub-bug 2: WAV ignored for ElevenLabs (#2)
?output_format=mp3_44100_128(611-612) and never referencescfg.audioFormat, unlike OpenAI/NanoGPT/PocketTTS. A carried-overaudioFormat: 'wav'is a no-op (playback still works via provider content-type).Sub-bug 3: NanoGPT non-TTS-model guard skipped (#39)
!useNanoGptSpeech(599), so a NanoGPT+ElevenLabs user selecting a TTV model gets an opaque 502 instead.Sub-bug 4: instructions injected for ElevenLabs-family NanoGPT models (#40)
speechInstructionsfor NanoGPT is computed fromuseNanoGptSpeechonly (617), with no model-family gate, so a tone causes aninstructionsfield to be sent to Elevenlabs-V3/Turbo NanoGPT models that have no such concept.Sub-bug 5: speed sent for eleven_v3 (#41)
Sub-bug 6: instructions gate uses raw cfg.model (#4) [latent]
cfg.model(619) instead of the resolved/trimmedmodel(592-597). No behavioral divergence today (default tts-1 isn't gpt-4o*), but it misfires if the default ever changes to a gpt-4o* model.Suggested Fix
Math.min(1.2, Math.max(0.7, cfg.speed))) and/or constrain the slider when source==='elevenlabs'.cfg.audioFormatto an ElevenLabsoutput_format, or hide WAV for ElevenLabs.useNanoGptSpeech.instructionson an OpenAI-style model family; omit speed for models that don't support it.modeltoopenAiModelSupportsSpeechInstructions.Verification checklist (all manual)
instructions/speedare only sent to models that support thempnpm checkAffected files
packages/server/src/routes/tts.routes.tspackages/shared/src/types/tts.tspackages/client/src/components/panels/settings/TTSConfigCard.tsxAudit provenance
Found by a multi-agent static audit of the TTS/voice + image-generation subsystems (Round 1 + round-2 gap sweep + completeness critic, each finding adversarially verified) against the merged
stagingtree. Severity: MEDIUM.@SpicyMarinara commented on GitHub (Jun 21, 2026):
Addressed on PR #2747. Direct ElevenLabs TTS now clamps speed to 0.7-1.2 when supported, omits speed for Eleven v3, and treats ElevenLabs audio format as mp3 server-side to match the UI. The non-TTS ElevenLabs model guard now also applies when routed through NanoGPT. NanoGPT ElevenLabs-family models no longer receive OpenAI-style instructions or speed fields, and OpenAI instruction gating now uses the resolved model id. Settings now shows the ElevenLabs speed range/clamped effective value instead of advertising the full OpenAI/local range. Validated with git diff --check for the touched files; full pnpm validation is deferred until the end of the issue sweep per maintainer request.