[GH-ISSUE #5191] [Issue]: Add Read Behind to custom lorebook agents and fix mobile Backfill button overflow #2871

Closed
opened 2026-10-21 05:57:20 +07:00 by bsakaguchi · 2 comments
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Custom agents that operate on lorebooks should support the Lorebook Keeper's Read Behind setting, allowing them to process chat history from a configurable number of messages behind the current turn. In mobile view, the Backfill Unprocessed button also escapes its container and should be moved to the line below.

Expected behavior

Custom lorebook agents should provide a configurable Read Behind value so they can avoid processing the current turn and creating duplicate entries after swipes. The Backfill Unprocessed button should remain within its container in mobile view, wrapping to the line below when necessary.

Actual behavior

Custom lorebook agents do not expose the Read Behind functionality, so swiping can cause the agent to propose a new entry on every swipe. In mobile view, the Backfill Unprocessed button escapes its containment.

Steps to reproduce

  1. Create or use a custom agent that operates on a lorebook.
  2. Use the agent with a lorebook and swipe or regenerate a chat turn.
  3. Observe that there is no Read Behind setting and that the agent can propose a new entry on each swipe.
  4. Open the relevant lorebook interface in mobile view and observe the Backfill Unprocessed button overflowing or escaping its container.

Environment

  • Marinara Engine version: 2.4.3 (build 427a747054)
  • Install type: Not provided
  • OS + version: Windows 10.0; mobile-view device/OS not provided
  • Browser or app shell: Samsung Browser indicated by the screenshot filename

Logs, screenshots, or video

Screenshot attached: https://cdn.discordapp.com/attachments/1538683835007373332/1538838858698072094/Screenshot_20260817_111529_Samsung_Browser.jpg?ex=6a8422de&is=6a82d15e&hm=ad636e5105c388b31ef84a58b06e0db9e872efbbf5babc46457829eb5fdb3be0

Additional context

The custom agent is intended to create new entries in a very large memory lorebook of approximately 70k tokens and growing, without reading or editing existing entries. The native Lorebook Keeper is reportedly injected every turn, which consumes substantial input tokens. Supporting Read Behind would help avoid unnecessary processing and token costs.

Discord thread: [FR] - Make the 'Read Behind' Functionality available to Custom Agents
Discord thread link: https://discord.com/channels/1417099416812392641/1538683835007373332
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (9 messages)
[2026-08-16T23:00:13.629Z] ylliselmanii: Marinara Engine diagnostics
Version: 2.4.3
Build: 427a7470549c
OS: Windows 10.0

Hello! As written in the title, I wanted to ask if custom agents, specifically ones that can edit lorebooks, could get the 'Read Behind' Function that the native Lorebook Keeper already has? I made a custom lorebook agent, as mine only has to create new entries in a VERY large memory lorebook (like 70k tokens and growing), not read or edit existing ones, which AFAIK the normal LB Agent gets injected every turn, which in turn eats up tons input tokens.

However, the fact that i can't tell my custom agent to read behind 1 message, means that if I swipe, it will propose a new entry on every swipe. Which isn't the end of the world, but still a waste of tokens -> money 🙁

So if that were possible, that'd be neat
[Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538683835007373332]

[2026-08-16T23:00:14.463Z] 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.`

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/1538683835007373332/1538683838505554101]

[2026-08-17T06:01:46.133Z] Marinara: I don't understand what "Read Behind" is.
[Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538789919458205716]

[2026-08-17T09:14:04.512Z] ylliselmanii: Am i high? Is it not called that?
[Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538838314927263815]

[2026-08-17T09:14:32.555Z] ylliselmanii: The thing with the lorebook keeper. That the chat history messages it gets are 1 behind the current turn
[Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538838432548265994]

[2026-08-17T09:14:58.140Z] ylliselmanii: Or rather, x behind
[Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538838539859394630]

[2026-08-17T09:16:14.234Z] ylliselmanii: (no text content)

[attached image 1: https://cdn.discordapp.com/attachments/1538683835007373332/1538838858698072094/Screenshot_20260817_111529_Samsung_Browser.jpg?ex=6a8422de&is=6a82d15e&hm=ad636e5105c388b31ef84a58b06e0db9e872efbbf5babc46457829eb5fdb3be0&]
[Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538838859021029467]

[2026-08-17T09:58:39.875Z] Marinara: Ah, there. I was looking for that in the agent editor.
[Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538849536213131367]

[2026-08-17T09:59:38.702Z] Marinara: Yes we can add that to custom agents that operate on lorebook. Also, Professor, add to the issue that on mobile view Backfill Unprocessed button escapes the containment; needs to be moved to the line under.
[Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538849782951579668]

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 17, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5191 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Custom agents that operate on lorebooks should support the Lorebook Keeper's Read Behind setting, allowing them to process chat history from a configurable number of messages behind the current turn. In mobile view, the Backfill Unprocessed button also escapes its container and should be moved to the line below. ## Expected behavior Custom lorebook agents should provide a configurable Read Behind value so they can avoid processing the current turn and creating duplicate entries after swipes. The Backfill Unprocessed button should remain within its container in mobile view, wrapping to the line below when necessary. ## Actual behavior Custom lorebook agents do not expose the Read Behind functionality, so swiping can cause the agent to propose a new entry on every swipe. In mobile view, the Backfill Unprocessed button escapes its containment. ## Steps to reproduce 1. Create or use a custom agent that operates on a lorebook. 2. Use the agent with a lorebook and swipe or regenerate a chat turn. 3. Observe that there is no Read Behind setting and that the agent can propose a new entry on each swipe. 4. Open the relevant lorebook interface in mobile view and observe the Backfill Unprocessed button overflowing or escaping its container. ## Environment - Marinara Engine version: 2.4.3 (build 427a7470549c) - Install type: Not provided - OS + version: Windows 10.0; mobile-view device/OS not provided - Browser or app shell: Samsung Browser indicated by the screenshot filename ## Logs, screenshots, or video Screenshot attached: https://cdn.discordapp.com/attachments/1538683835007373332/1538838858698072094/Screenshot_20260817_111529_Samsung_Browser.jpg?ex=6a8422de&is=6a82d15e&hm=ad636e5105c388b31ef84a58b06e0db9e872efbbf5babc46457829eb5fdb3be0 ## Additional context The custom agent is intended to create new entries in a very large memory lorebook of approximately 70k tokens and growing, without reading or editing existing entries. The native Lorebook Keeper is reportedly injected every turn, which consumes substantial input tokens. Supporting Read Behind would help avoid unnecessary processing and token costs. Discord thread: [FR] - Make the 'Read Behind' Functionality available to Custom Agents Discord thread link: https://discord.com/channels/1417099416812392641/1538683835007373332 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (9 messages)</summary> ```text [2026-08-16T23:00:13.629Z] ylliselmanii: Marinara Engine diagnostics Version: 2.4.3 Build: 427a7470549c OS: Windows 10.0 Hello! As written in the title, I wanted to ask if custom agents, specifically ones that can edit lorebooks, could get the 'Read Behind' Function that the native Lorebook Keeper already has? I made a custom lorebook agent, as mine only has to create new entries in a VERY large memory lorebook (like 70k tokens and growing), not read or edit existing ones, which AFAIK the normal LB Agent gets injected every turn, which in turn eats up tons input tokens. However, the fact that i can't tell my custom agent to read behind 1 message, means that if I swipe, it will propose a new entry on every swipe. Which isn't the end of the world, but still a waste of tokens -> money 🙁 So if that were possible, that'd be neat [Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538683835007373332] [2026-08-16T23:00:14.463Z] 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.` 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/1538683835007373332/1538683838505554101] [2026-08-17T06:01:46.133Z] Marinara: I don't understand what "Read Behind" is. [Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538789919458205716] [2026-08-17T09:14:04.512Z] ylliselmanii: Am i high? Is it not called that? [Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538838314927263815] [2026-08-17T09:14:32.555Z] ylliselmanii: The thing with the lorebook keeper. That the chat history messages it gets are 1 behind the current turn [Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538838432548265994] [2026-08-17T09:14:58.140Z] ylliselmanii: Or rather, x behind [Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538838539859394630] [2026-08-17T09:16:14.234Z] ylliselmanii: (no text content) [attached image 1: https://cdn.discordapp.com/attachments/1538683835007373332/1538838858698072094/Screenshot_20260817_111529_Samsung_Browser.jpg?ex=6a8422de&is=6a82d15e&hm=ad636e5105c388b31ef84a58b06e0db9e872efbbf5babc46457829eb5fdb3be0&] [Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538838859021029467] [2026-08-17T09:58:39.875Z] Marinara: Ah, there. I was looking for that in the agent editor. [Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538849536213131367] [2026-08-17T09:59:38.702Z] Marinara: Yes we can add that to custom agents that operate on lorebook. Also, Professor, add to the issue that on mobile view Backfill Unprocessed button escapes the containment; needs to be moved to the line under. [Discord message: https://discord.com/channels/1417099416812392641/1538683835007373332/1538849782951579668] ``` </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 05:57:20 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Aug 17, 2026):

I’m taking this issue. Implementation is starting on fix/5191-custom-agent-read-behind; I’ll keep the context-window behavior and mobile layout fix focused in one issue-linked PR.

<!-- gh-comment-id:5314950291 --> @SpicyMarinara commented on GitHub (Aug 17, 2026): I’m taking this issue. Implementation is starting on `fix/5191-custom-agent-read-behind`; I’ll keep the context-window behavior and mobile layout fix focused in one issue-linked PR.
Author
Owner

@SpicyMarinara commented on GitHub (Aug 17, 2026):

Resolved by #5193 and merged into staging in feb276cd8.

<!-- gh-comment-id:5315625490 --> @SpicyMarinara commented on GitHub (Aug 17, 2026): Resolved by #5193 and merged into staging in feb276cd8.
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#2871
No description provided.