[GH-ISSUE #5159] [Issue]: Roleplay speaker extractor must emit inline bracketed emotion indicators #2855

Closed
opened 2026-10-21 05:56:56 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @SpicyMarinara on GitHub (Aug 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5159

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The Roleplay speaker extractor's Enable emotion indicators implementation does not match the intended behavior. It currently asks for one optional tone per dialogue line, but emotion indicators are supposed to be bracketed cues inserted directly into the dialogue text sent to TTS, including multiple cues at different positions within one line.

Expected behavior

When emotion indicators are enabled, add this instruction to the extractor prompt:

You may add multiple bracketed emotional indicators within a dialogue line, including pauses, small sounds, sighs, and different intonations for different parts.

The prompt example must demonstrate inline bracketed indicators, including multiple indicators in one dialogue line:

Dottore: [irritated] I've had enough of your shenanigans.
Dottore: [irritated] You're wasting my time, subject. [sigh] This is your last chance to change my mind before I send you to Lab Thirteen.
Mari: [chuckle] Skill issue.

Requirements:

  • Bracketed indicators such as [irritated], [sigh], [pause], and [chuckle] must be embedded at their intended positions in the dialogue sent to TTS.
  • Do not represent the behavior as one tone value for the whole line.
  • Do not collapse multiple indicators into a single leading instruction.
  • Dialogue words must otherwise remain verbatim.
  • Keep the original unannotated dialogue available for locating it in the source message and reconstructing narration; inserted indicators must not make source matching fail.
  • Speaker-to-voice routing and narration extraction must remain unchanged.
  • When emotion indicators are disabled, send the exact dialogue without inserted bracketed cues.
  • Update the extractor example and regression coverage to include at least one line with multiple inline indicators.

Actual behavior

buildRoleplaySpeakerExtractorPrompt() currently requests:

Add a short emotional indicator or expression in the optional "tone" field for each line

The JSON example provides only one tone for each entire line. parseRoleplaySpeakerExtractorOutput() then places that value on the dialogue segment as tone, and the downstream request path treats it as a single overall delivery instruction or leading cue. This loses the intended inline placement and cannot express changing delivery, pauses, or sounds within a line.

Steps to reproduce

  1. Enable Roleplay speaker extractor and Enable emotion indicators.
  2. Generate dialogue whose delivery changes within a single line, such as irritation followed by a sigh.
  3. Inspect the extractor prompt/output or TTS request.
  4. Observe that the result contains only one tone value for the entire line instead of multiple inline bracketed indicators.

Environment

  • Marinara Engine version: 2.4.3
  • Install type: source
  • OS + version: Not environment-specific
  • Browser or app shell: Not environment-specific

Logs, screenshots, or video

Not applicable. The current behavior is visible in:

  • packages/server/src/routes/tts.routes.ts — buildRoleplaySpeakerExtractorPrompt() and parseRoleplaySpeakerExtractorOutput()
  • packages/shared/src/types/tts.ts — the dialogue segment's optional tone
  • packages/client/src/lib/tts-roleplay-speaker-extractor.ts — TTS job construction

Additional context

This is a correction to the existing feature, not a request to enrich the current tone field. The tone representation is the implementation mistake being corrected.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Aug 16, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5159 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The Roleplay speaker extractor's **Enable emotion indicators** implementation does not match the intended behavior. It currently asks for one optional `tone` per dialogue line, but emotion indicators are supposed to be bracketed cues inserted directly into the dialogue text sent to TTS, including multiple cues at different positions within one line. ## Expected behavior When emotion indicators are enabled, add this instruction to the extractor prompt: > You may add multiple bracketed emotional indicators within a dialogue line, including pauses, small sounds, sighs, and different intonations for different parts. The prompt example must demonstrate inline bracketed indicators, including multiple indicators in one dialogue line: ```text Dottore: [irritated] I've had enough of your shenanigans. Dottore: [irritated] You're wasting my time, subject. [sigh] This is your last chance to change my mind before I send you to Lab Thirteen. Mari: [chuckle] Skill issue. ``` Requirements: - Bracketed indicators such as `[irritated]`, `[sigh]`, `[pause]`, and `[chuckle]` must be embedded at their intended positions in the dialogue sent to TTS. - Do not represent the behavior as one `tone` value for the whole line. - Do not collapse multiple indicators into a single leading instruction. - Dialogue words must otherwise remain verbatim. - Keep the original unannotated dialogue available for locating it in the source message and reconstructing narration; inserted indicators must not make source matching fail. - Speaker-to-voice routing and narration extraction must remain unchanged. - When emotion indicators are disabled, send the exact dialogue without inserted bracketed cues. - Update the extractor example and regression coverage to include at least one line with multiple inline indicators. ## Actual behavior `buildRoleplaySpeakerExtractorPrompt()` currently requests: ```text Add a short emotional indicator or expression in the optional "tone" field for each line ``` The JSON example provides only one `tone` for each entire line. `parseRoleplaySpeakerExtractorOutput()` then places that value on the dialogue segment as `tone`, and the downstream request path treats it as a single overall delivery instruction or leading cue. This loses the intended inline placement and cannot express changing delivery, pauses, or sounds within a line. ## Steps to reproduce 1. Enable **Roleplay speaker extractor** and **Enable emotion indicators**. 2. Generate dialogue whose delivery changes within a single line, such as irritation followed by a sigh. 3. Inspect the extractor prompt/output or TTS request. 4. Observe that the result contains only one `tone` value for the entire line instead of multiple inline bracketed indicators. ## Environment - Marinara Engine version: 2.4.3 - Install type: source - OS + version: Not environment-specific - Browser or app shell: Not environment-specific ## Logs, screenshots, or video Not applicable. The current behavior is visible in: - `packages/server/src/routes/tts.routes.ts` — `buildRoleplaySpeakerExtractorPrompt()` and `parseRoleplaySpeakerExtractorOutput()` - `packages/shared/src/types/tts.ts` — the dialogue segment's optional `tone` - `packages/client/src/lib/tts-roleplay-speaker-extractor.ts` — TTS job construction ## Additional context This is a correction to the existing feature, not a request to enrich the current `tone` field. The `tone` representation is the implementation mistake being corrected. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [x] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:56:56 +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#2855
No description provided.