[GH-ISSUE #8661] [Issue]: Message text renders duplicated or misplaced after speaker-tag updates #8447

Closed
opened 2026-11-07 16:43:01 +07:00 by bsakaguchi · 2 comments
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

After a custom post-processing agent changes speaker-tag boundaries in a merged RP message, the displayed text can contain duplicated or misplaced words. The underlying text appears intact: entering and exiting edit mode without changes restores the correct display.

Expected behavior

Updated messages should render their narration and dialogue text correctly, without duplicated or misplaced words.

Actual behavior

Some updated messages display duplicated or misplaced text until they are remounted by entering and exiting edit mode.

Steps to reproduce

  1. In merged RP mode, generate a reply containing narration and speaker tags.
  2. Let a custom post-processing agent correct the speaker tags.
  3. Observe that the updated message may display duplicated or misplaced text.
  4. Enter and exit edit mode without changing the content; the display becomes correct.

Environment

  • Marinara Engine version: 2.5.1 (build 2.5.1+e7bdce93eab2)
  • Install type: Not provided
  • OS + version: Client: Windows 10.0; server: Linux 7.0.0-38-generic (x64)
  • Browser or app shell: Microsoft Edge 156.0.0.0 (Chromium)

Logs, screenshots, or video

A local browser test using renderWithSpeakerTags() and highlightDialogue() reproduced the issue when changing only speaker-tag boundaries: expected Alpha "One" Beta "Two" Gamma; after updating, AlphaAlpha "One"Beta Beta "Two" Gamma; after remounting, the correct text returned. React reported duplicate child-key warnings. No screenshot or video provided.

Additional context

The reporter suspects duplicate React keys: narration segments are flattened with dialogue into one children array, while key counters restart on each call. The same rendering logic was found in the reporter's staging build. The exact affected message was not tested separately, so the reproduction is suggestive rather than confirmed for that message. Consider checking key uniqueness across narration and dialogue segments in ChatMessage.tsx. Active connection: Nano; provider: nanogpt; model: xiaomi/mimo-v2.6-pro.

Discord thread: Message text becomes visually corrupted after a custom agent changes message
Discord thread link: https://discord.com/channels/1417099416812392641/1566552493729775676
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (3 messages)
[2026-11-01T20:40:19.643Z] kociol21: I'm using a custom post-processing agent that fixes <speaker="Name">...</speaker> tags (as some smaller models totally mess them up) in merged RP mode. After it updates a reply, the displayed message sometimes contains duplicated words and mixed-up text.

However, double-clicking the message to edit it shows the correct text. Exiting edit mode without changing anything immediately fixes the display.

Steps to reproduce:
1. Generate a reply containing narration and speaker tags.
2. Let some  custom agent correct the tags.
3. The updated message may display duplicated or misplaced text.
4. Enter and exit edit mode without changing the content.
5. The message now displays correctly.
Possible cause: duplicate React keys

A local browser test using Marinara's renderWithSpeakerTags() and highlightDialogue() functions reproduced this behavior. Narration segments are flattened into the same children array, but their key counters restart on each call, producing duplicate sibling keys.

Changing only speaker-tag boundaries, while preserving all words, produced:
- Expected: Alpha "One" Beta "Two" Gamma
- After updating: AlphaAlpha "One"Beta Beta "Two" Gamma
- After remounting: the correct text again.
React also reported duplicate child-key warnings. The same rendering logic was found in my deployed staging build.

This looks like a rendering/reconciliation issue rather than corrupted message content. Could you check key uniqueness across narration and dialogue segments in ChatMessage.tsx? The reproduction strongly matches my symptoms, although my exact affected message hasn't been tested separately.
[Discord message: https://discord.com/channels/1417099416812392641/1566552493729775676/1566552493729775676]

[2026-11-01T20:40:20.140Z] Professor Mari [bot]: Howdy!

Thank you for submitting a new bug report/feature request, your support means a lot. A member of the team will look into it as soon as possible, and if they find it valid, they will open a GitHub Issue out of it. You can check whether it was addressed on the staging build of Marinara Engine. **Do not ping any of the developers, this will not speed up the process.**

**Please include a Support Diagnostic in the post if you haven't done it yet.** Otherwise, ignore this step. To grab it, go to the Marinara Engine tab:

`Settings -> Advanced -> Support Diagnostics -> Copy Support Diagnostics.`

If your report is about any of the **Agents**, please provide **the Agent's version** which you can grab from here:

`Agents -> Download Agents -> Installed Agents -> Selected Agent -> Installed Version`

Thank you, this will help tremendously.

This is an automated message, but if you reply to it, I will do my best to assist you using my LLM-powered brain. That said, it's best for a human to handle this case.

Cheers!
[Discord message: https://discord.com/channels/1417099416812392641/1566552493729775676/1566552495814213759]

[2026-11-01T20:43:25.436Z] kociol21: ` ` `
Marinara Engine diagnostics
Version: 2.5.1
Build: 2.5.1+e7bdce93eab2
Commit: e7bdce93eab2
Server OS: Linux 7.0.0-38-generic (x64)
Server memory: heap 212.5 / 864 MiB; RSS 430.6 MiB
Background wake lock: not reported
Last detected freeze: none detected
Previous session: restarted itself for an update or a settings restart at 2026-11-01T10:43:30.611Z
Sessions ended without shutdown: 2 recorded
Client OS: Windows 10.0
Browser / app shell: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36 Edg/156.0.0.0
Client runtime: {"build":"2.5.1+e7bdce93eab2","page":"mvxt9ek5-eei8q4h2","persistence":"local","navigation":"reload","standalone":true,"view":[1072,0,0,0],"events":[{"at":1793561390252,"page":"mvxt9ek5-eei8q4h2","build":"2.5.1+e7bdce93eab2","kind":"message-edited","view":[1072,0,0,0]},{"at":1793565370483,"page":"mvxt9ek5-eei8q4h2","build":"2.5.1+e7bdce93eab2","kind":"message-edited","view":[1072,0,0,0]}]}
GPU: ANGLE (AMD, AMD Radeon RX 9070 XT (0x00007550) Direct3D11 vs_5_0 ps_5_0, D3D11)
Server GPU: no NVIDIA GPU detected
Main sidecar: not configured
Utility sidecar: not configured
Decision sidecar: not configured
Sidecar load: not measured
Active connection: Nano
Connection provider: nanogpt
LLM model: xiaomi/mimo-v2.6-pro
Professor Mari last acted on: none recorded this session
` ` `
[Discord message: https://discord.com/channels/1417099416812392641/1566552493729775676/1566553273002106976]

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 (Nov 1, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8661 Originally assigned to: @SpicyMarinara on GitHub. ## Summary After a custom post-processing agent changes speaker-tag boundaries in a merged RP message, the displayed text can contain duplicated or misplaced words. The underlying text appears intact: entering and exiting edit mode without changes restores the correct display. ## Expected behavior Updated messages should render their narration and dialogue text correctly, without duplicated or misplaced words. ## Actual behavior Some updated messages display duplicated or misplaced text until they are remounted by entering and exiting edit mode. ## Steps to reproduce 1. In merged RP mode, generate a reply containing narration and speaker tags. 2. Let a custom post-processing agent correct the speaker tags. 3. Observe that the updated message may display duplicated or misplaced text. 4. Enter and exit edit mode without changing the content; the display becomes correct. ## Environment - Marinara Engine version: 2.5.1 (build 2.5.1+e7bdce93eab2) - Install type: Not provided - OS + version: Client: Windows 10.0; server: Linux 7.0.0-38-generic (x64) - Browser or app shell: Microsoft Edge 156.0.0.0 (Chromium) ## Logs, screenshots, or video A local browser test using renderWithSpeakerTags() and highlightDialogue() reproduced the issue when changing only speaker-tag boundaries: expected `Alpha "One" Beta "Two" Gamma`; after updating, `AlphaAlpha "One"Beta Beta "Two" Gamma`; after remounting, the correct text returned. React reported duplicate child-key warnings. No screenshot or video provided. ## Additional context The reporter suspects duplicate React keys: narration segments are flattened with dialogue into one children array, while key counters restart on each call. The same rendering logic was found in the reporter's staging build. The exact affected message was not tested separately, so the reproduction is suggestive rather than confirmed for that message. Consider checking key uniqueness across narration and dialogue segments in ChatMessage.tsx. Active connection: Nano; provider: nanogpt; model: xiaomi/mimo-v2.6-pro. Discord thread: Message text becomes visually corrupted after a custom agent changes message Discord thread link: https://discord.com/channels/1417099416812392641/1566552493729775676 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (3 messages)</summary> ```text [2026-11-01T20:40:19.643Z] kociol21: I'm using a custom post-processing agent that fixes <speaker="Name">...</speaker> tags (as some smaller models totally mess them up) in merged RP mode. After it updates a reply, the displayed message sometimes contains duplicated words and mixed-up text. However, double-clicking the message to edit it shows the correct text. Exiting edit mode without changing anything immediately fixes the display. Steps to reproduce: 1. Generate a reply containing narration and speaker tags. 2. Let some custom agent correct the tags. 3. The updated message may display duplicated or misplaced text. 4. Enter and exit edit mode without changing the content. 5. The message now displays correctly. Possible cause: duplicate React keys A local browser test using Marinara's renderWithSpeakerTags() and highlightDialogue() functions reproduced this behavior. Narration segments are flattened into the same children array, but their key counters restart on each call, producing duplicate sibling keys. Changing only speaker-tag boundaries, while preserving all words, produced: - Expected: Alpha "One" Beta "Two" Gamma - After updating: AlphaAlpha "One"Beta Beta "Two" Gamma - After remounting: the correct text again. React also reported duplicate child-key warnings. The same rendering logic was found in my deployed staging build. This looks like a rendering/reconciliation issue rather than corrupted message content. Could you check key uniqueness across narration and dialogue segments in ChatMessage.tsx? The reproduction strongly matches my symptoms, although my exact affected message hasn't been tested separately. [Discord message: https://discord.com/channels/1417099416812392641/1566552493729775676/1566552493729775676] [2026-11-01T20:40:20.140Z] Professor Mari [bot]: Howdy! Thank you for submitting a new bug report/feature request, your support means a lot. A member of the team will look into it as soon as possible, and if they find it valid, they will open a GitHub Issue out of it. You can check whether it was addressed on the staging build of Marinara Engine. **Do not ping any of the developers, this will not speed up the process.** **Please include a Support Diagnostic in the post if you haven't done it yet.** Otherwise, ignore this step. To grab it, go to the Marinara Engine tab: `Settings -> Advanced -> Support Diagnostics -> Copy Support Diagnostics.` If your report is about any of the **Agents**, please provide **the Agent's version** which you can grab from here: `Agents -> Download Agents -> Installed Agents -> Selected Agent -> Installed Version` Thank you, this will help tremendously. This is an automated message, but if you reply to it, I will do my best to assist you using my LLM-powered brain. That said, it's best for a human to handle this case. Cheers! [Discord message: https://discord.com/channels/1417099416812392641/1566552493729775676/1566552495814213759] [2026-11-01T20:43:25.436Z] kociol21: ` ` ` Marinara Engine diagnostics Version: 2.5.1 Build: 2.5.1+e7bdce93eab2 Commit: e7bdce93eab2 Server OS: Linux 7.0.0-38-generic (x64) Server memory: heap 212.5 / 864 MiB; RSS 430.6 MiB Background wake lock: not reported Last detected freeze: none detected Previous session: restarted itself for an update or a settings restart at 2026-11-01T10:43:30.611Z Sessions ended without shutdown: 2 recorded Client OS: Windows 10.0 Browser / app shell: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36 Edg/156.0.0.0 Client runtime: {"build":"2.5.1+e7bdce93eab2","page":"mvxt9ek5-eei8q4h2","persistence":"local","navigation":"reload","standalone":true,"view":[1072,0,0,0],"events":[{"at":1793561390252,"page":"mvxt9ek5-eei8q4h2","build":"2.5.1+e7bdce93eab2","kind":"message-edited","view":[1072,0,0,0]},{"at":1793565370483,"page":"mvxt9ek5-eei8q4h2","build":"2.5.1+e7bdce93eab2","kind":"message-edited","view":[1072,0,0,0]}]} GPU: ANGLE (AMD, AMD Radeon RX 9070 XT (0x00007550) Direct3D11 vs_5_0 ps_5_0, D3D11) Server GPU: no NVIDIA GPU detected Main sidecar: not configured Utility sidecar: not configured Decision sidecar: not configured Sidecar load: not measured Active connection: Nano Connection provider: nanogpt LLM model: xiaomi/mimo-v2.6-pro Professor Mari last acted on: none recorded this session ` ` ` [Discord message: https://discord.com/channels/1417099416812392641/1566552493729775676/1566553273002106976] ``` </details> ## 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.
bsakaguchi 2026-11-07 16:43:01 +07:00
  • closed this issue
  • added the
    bug
    in-pr
    labels
Author
Owner

@coderabbitai[bot] commented on GitHub (Nov 1, 2026):

⚠️ Possible Duplicate Issue(s)

📝 Issue Planner

Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

  • Create Plan

🧪 Issue enrichment is currently in open beta.

You can configure auto-planning by selecting labels in the issue_enrichment configuration.

To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

issue_enrichment:
  auto_enrich:
    enabled: false

💬 Have feedback or questions? Drop into our discord!

<!-- gh-comment-id:6564140802 --> @coderabbitai[bot] commented on GitHub (Nov 1, 2026): <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated issue plan by CodeRabbit --> <details> <summary>⚠️ Possible Duplicate Issue(s)</summary> <dl> <dd> - https://github.com/Pasta-Devs/Marinara-Engine/issues/8626 </dd> </dl> </details> --- <details> <summary>📝 Issue Planner</summary> <dl> <dd> <sub>Check the box below or use the `@coderabbitai plan` command to generate an implementation plan and prompts that you can use with your favorite coding assistant.</sub> - [ ] <!-- {"checkboxId":"8d4f2b9c-3e1a-4f7c-a9b2-d5e8f1c4a7b9"} --> Create Plan </dd> </dl> </details> --- <details> <summary> 🧪 Issue enrichment is currently in open beta.</summary> <dl> <dd> You can configure auto-planning by selecting labels in the issue_enrichment configuration. To disable automatic issue enrichment, add the following to your `.coderabbit.yaml`: ```yaml issue_enrichment: auto_enrich: enabled: false ``` </dd> </dl> </details> 💬 Have feedback or questions? Drop into our [discord](https://discord.gg/coderabbit)!
Author
Owner

@SpicyMarinara commented on GitHub (Nov 1, 2026):

Fixed on staging by #8632; #8670 adds a regression for this exact scenario (speaker-tag boundaries moving over the same words). Users on v2.5.1 keep seeing it until staging is promoted to main.

<!-- gh-comment-id:6565343106 --> @SpicyMarinara commented on GitHub (Nov 1, 2026): Fixed on staging by #8632; #8670 adds a regression for this exact scenario (speaker-tag boundaries moving over the same words). Users on v2.5.1 keep seeing it until staging is promoted to main.
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#8447
No description provided.