mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #768] [Issue]: Lorebook automation/agent system fails to overwrite #369
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#369
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 @Navgner on GitHub (May 12, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/768
Originally assigned to: @Promansis on GitHub.
Summary
Expected behavior
Actual behavior
Summary
The Lorebook automation/agent system fails to overwrite existing entries when the "action": "update" parameter is returned by the LLM. Instead of replacing the old text, the engine appends the new text to the end of the entry, causing massive text duplication.
Expected behavior
When an agent/prompt outputs a JSON payload containing "action": "update" (or similar logic) for a specific entryName, the system's backend should completely overwrite the existing content of that Lorebook entry with the new content provided in the JSON.
Actual behavior
The system concatenates (appends) the new content to the existing one. For example, if a relationship entry is updated 5 times during a roleplay session, the Lorebook will contain 5 chronological versions of the same entry pasted one after the other, completely breaking the token limit and formatting.
Steps to reproduce
Result in the Lorebook (Bug):
Status: Professional Employer-Employee
[...old text...]
Status: Candid Professionalism
[...older text...]
Status: Playful Professionalism
[...new text added at the end instead of replacing everything...]
Additional context
The prompt explicitly instructs the LLM to "synthesize, rewrite, and not append", and the LLM correctly outputs a single, clean JSON block with the "action": "update" flag. The issue lies strictly in how the engine handles the insertion of the updated text into the Lorebook database.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: