mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2280] [Issue]: Editing a linked lorebook's header metadata does not propagate into the character's embedded character_book (stale header in card exports) #1118
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#1118
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 @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2280
Originally assigned to: @cha1latte on GitHub.
Summary
The entry-level character_book sync added for #2158 mirrors entries correctly, but a lorebook-row metadata edit (name, scan depth, token budget, recursive scanning) is never re-synced into the linked character's embedded character_book header, so an exported character card ships a stale header.
Expected behavior
Editing a linked lorebook's header fields should re-derive the embedded character_book header on the linked character, matching main, so a later character PNG export carries the current values.
Actual behavior
A lorebook metadata update falls through to the generic storage patch with no character_book sync, and the entry-sync helper only rewrites the entries array (never the header) and only fires on entry CRUD. The embedded header keeps its import-time values and that stale header ships into the exported chara_card_v3.
Steps to reproduce
Impact area
Regression notes
Worked on main. Main calls
syncCharacterBookFromLorebookon every standalone mutation including the metadata PATCH (packages/server/src/routes/lorebooks.routes.ts:267), andtoCharacterBookre-derives the full header plus entries (packages/server/src/services/lorebook/character-book-sync.ts:70-80). The refactor'ssync_linked_character_books_for_lorebook_in_placeonly rewritesbook["entries"](src-tauri/src/commands/storage/commands/entities.rs:1217-1227) and fires only on entry CRUD; a lorebook metadata update routes through the genericstate.storage.patch(entities.rs:498-502) with no sync. Header fields are written into character_book only at import (normalization.rs:432-434), andcompatible_character_exportemitsdata.character_bookverbatim (exports.rs:401-407). Export-only and invisible in the Lorebook tab, hence minor.Environment
5ddb9840(compared against main @b4ab97f)Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: