mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2754] [Issue]: TTS dialogue segmentation speaks markdown/code literally and mis-classifies bracketed lines #1392
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#1392
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/2754
Originally assigned to: @SpicyMarinara on GitHub.
Summary
tts-dialogue.tstext cleaning and dialogue classification mishandle common roleplay/markdown formatting.cleanTTSInputTextremoves{effect:}/[tag:]/<html>but no markdown, so asterisk actions, emphasis, headings, and code are sent verbatim to the synth. Separately, the dialogueOnly VN-line regex over-matches incidental[x]: ylines and short-circuits the quote fallback, dropping genuine dialogue.Sub-bug 1: Markdown spoken literally (#7)
cleanTTSInputText(236-243) has rules only for{effect:},[tag:](requires a colon inside brackets), and<...>— nothing for* _** # ~~or[label](url). In the default non-dialogueOnly path with no<speaker>tags, the whole cleaned message is spoken.*She smiles* **Hello**, run \npm test`` is POSTed to TTS with asterisks/backticks intact -> odd pauses or literal vocalization.Sub-bug 2: Code blocks spoken (#69)
Sub-bug 3: VN-line over-match drops dialogue (#8)
extractDialogueUtterancesmatchesvnLineRe(376) whose speaker group accepts any non-bracket content.[note]: https://...,[12:30]: ...,[OOC]: be right backall parse as utterances; because any match triggers an early return (394-395), the quote-based fallback never runs and real quoted dialogue is dropped.[OOC]: be right back\n"Where did everyone go?"-> speaks 'be right back', the real quote is never spoken.Suggested Fix
Extend
cleanTTSInputTextto strip fenced/inline code, emphasis markers (** __ * _ ~~), heading/blockquote/list markers, and convert[label](url)tolabel, before whitespace collapse. TightenvnLineReso the bracketed speaker can't be a URL/time/known meta tag (or require a known-speaker set), and don't early-return on a single weak VN match so the quote fallback can still contribute.Verification checklist (all manual)
[OOC]:/reference-link/timestamp lines as dialogue and still speaks genuine quotespnpm checkAffected files
packages/client/src/lib/tts-dialogue.tsAudit 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. TTS input cleaning now strips fenced and inline code, markdown links/images, headings, blockquotes, list markers, and emphasis markers before synthesis. Dialogue-only VN parsing now rejects likely meta labels such as OOC/note/timestamps/URLs/numeric labels, and quote fallback always runs so a bad bracket line cannot suppress real quoted dialogue. Validated with git diff --check for the touched file; full pnpm validation is deferred until the end of the issue sweep per maintainer request.