[GH-ISSUE #5716] [Issue]: Lorebook entry duplicated in Before Char and After Char placeholders #3162

Closed
opened 2026-10-21 06:00:08 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @Romuromylus on GitHub.

Summary

A lorebook entry configured for insertion Before Char is duplicated across both the Before Char and After Char preset placeholders.

Expected behavior

The lorebook entry should be inserted only at the configured Before Char placeholder.

Actual behavior

The entry appears at both the Before Char and After Char placeholders, as shown in the chat prompt inspection.

Steps to reproduce

  1. Create or configure a lorebook entry with its insertion position set to Before Char.
  2. Use the lorebook entry in a chat.
  3. Open the chat's prompt inspection.
  4. Observe that the entry is present in both the Before Char and After Char placeholders.

Environment

  • Marinara Engine version: 2.4.5 (build 2.4.5+e96412040c3c, commit e96412040c)
  • Install type: Not provided
  • OS + version: Linux 6.8.0-138-generic (x64)
  • Browser or app shell: Not provided

Logs, screenshots, or video

No logs, screenshots, or video provided. The duplication is visible in the chat's prompt inspection.

Additional context

Diagnostics reported heap usage of 690 / 4288 MiB, RSS of 926.4 MiB, no detected freeze, and background wake lock status not reported.

Discord thread: [Bug]: Lorebook insertion duplications (Before Char/After Char)
Discord thread link: https://discord.com/channels/1417099416812392641/1544252303391989830
Requested by: gunterlie (gunterlie, Discord ID 282074442962829312)

Discord thread transcript (2 messages)
[2026-09-01T07:47:19.949Z] m;aemoifmpfmmafe: Hi,

Just encountered an issue with a lorebook entry insertion duplicated over both within the preset (before char) and (after char) placeholders.
The issue can be reviewed within the chat's prompt inspection.

Entry was defined as before char.

Marinara Engine diagnostics
Version: 2.4.5
Build: 2.4.5+e96412040c3c
Commit: e96412040c3c
Server OS: Linux 6.8.0-138-generic (x64)
Server memory: heap 690 / 4288 MiB; RSS 926.4 MiB
Background wake lock: not reported
Last detected freeze: none detected
[Discord message: https://discord.com/channels/1417099416812392641/1544252303391989830/1544252303391989830]

[2026-09-01T07:47:20.572Z] 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/1544252303391989830/1544252306005041162]

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 (Sep 1, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5716 Originally assigned to: @Romuromylus on GitHub. ## Summary A lorebook entry configured for insertion Before Char is duplicated across both the Before Char and After Char preset placeholders. ## Expected behavior The lorebook entry should be inserted only at the configured Before Char placeholder. ## Actual behavior The entry appears at both the Before Char and After Char placeholders, as shown in the chat prompt inspection. ## Steps to reproduce 1. Create or configure a lorebook entry with its insertion position set to Before Char. 2. Use the lorebook entry in a chat. 3. Open the chat's prompt inspection. 4. Observe that the entry is present in both the Before Char and After Char placeholders. ## Environment - Marinara Engine version: 2.4.5 (build 2.4.5+e96412040c3c, commit e96412040c3c) - Install type: Not provided - OS + version: Linux 6.8.0-138-generic (x64) - Browser or app shell: Not provided ## Logs, screenshots, or video No logs, screenshots, or video provided. The duplication is visible in the chat's prompt inspection. ## Additional context Diagnostics reported heap usage of 690 / 4288 MiB, RSS of 926.4 MiB, no detected freeze, and background wake lock status not reported. Discord thread: [Bug]: Lorebook insertion duplications (Before Char/After Char) Discord thread link: https://discord.com/channels/1417099416812392641/1544252303391989830 Requested by: gunterlie (gunterlie, Discord ID 282074442962829312) <details> <summary>Discord thread transcript (2 messages)</summary> ```text [2026-09-01T07:47:19.949Z] m;aemoifmpfmmafe: Hi, Just encountered an issue with a lorebook entry insertion duplicated over both within the preset (before char) and (after char) placeholders. The issue can be reviewed within the chat's prompt inspection. Entry was defined as before char. Marinara Engine diagnostics Version: 2.4.5 Build: 2.4.5+e96412040c3c Commit: e96412040c3c Server OS: Linux 6.8.0-138-generic (x64) Server memory: heap 690 / 4288 MiB; RSS 926.4 MiB Background wake lock: not reported Last detected freeze: none detected [Discord message: https://discord.com/channels/1417099416812392641/1544252303391989830/1544252303391989830] [2026-09-01T07:47:20.572Z] 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/1544252303391989830/1544252306005041162] ``` </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-10-21 06:00:08 +07:00
Author
Owner

@Romuromylus commented on GitHub (Sep 2, 2026):

Fixed by #5760, squash-merged into staging as 4798d4167. Each world-info position is now placed by the first lorebook marker that covers it, so a preset with more than one lorebook marker no longer repeats the same entries across placeholders.

<!-- gh-comment-id:5508289345 --> @Romuromylus commented on GitHub (Sep 2, 2026): Fixed by #5760, squash-merged into `staging` as 4798d4167. Each world-info position is now placed by the first lorebook marker that covers it, so a preset with more than one lorebook marker no longer repeats the same entries across placeholders.
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#3162
No description provided.