mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3341] [Feature]: Embed a linked character lorebook into the card so it exports #1812
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#1812
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 @kolacheee on GitHub (Jul 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3341
Originally assigned to: @kolacheee on GitHub.
What problem does this solve?
Character cards can carry an embedded lorebook (the V2
character_book) that travels with the card on export — but there's no way to create that state from inside Marinara. If I build a lorebook and attach it with Assign Lorebook, it becomes a linked lorebook: a separate entity that just references the character. Linked lorebooks are not written into the card and do not export with it —GET /characters/:id/exportserializes the character'sdataas-is, and linked lorebooks live in their own rows, so they get left behind.The practical consequence: the only characters that export with a working lorebook are ones I imported with an embedded book already. Anything I author or link myself can't be shared as a self-contained card, which defeats the point of exporting for backup or sharing.
Concretely (screenshots below): my imported KZK card shows Reimport Embedded Lorebook / Edit Linked Lorebook because it has embedded data. My Floyd card, where I attached the same lorebook via Assign Lorebook, only shows Assign Lorebook — there is no way to embed it, and exporting Floyd silently drops the lorebook.
Proposed solution
An "Embed into card" action on a linked character-category lorebook that writes its current entries into the character's
data.character_bookand sets theextensions.importMetadata.embeddedLorebookback-pointer — i.e. the inverse of the existing Import Embedded Lorebook (which only goes card → standalone). After embedding:character_book, exactly like an imported embedded book.The conversion primitive already exists server-side (
toCharacterBookincharacter-book-sync.ts), so this is mostly wiring plus guards for the single-character_bookslot.Alternatives considered
/export— rejected: linked lorebooks are shared, reusable entities (one book can attach to many characters), so silently baking one into a single card's data would be surprising and could fork/duplicate it. An explicit, opt-in embed action keeps the intent clear.Additional context
Verified in the v2.1.0 code: the only embedded-lorebook endpoint is
POST /characters/:id/embedded-lorebook/import(card → standalone) — there is no standalone → card path. Both export builders (buildNativeCharacterEnvelope,buildCompatibleCharacterExport) serializecharDataas-is, andsyncCharacterBookFromLorebookis a documented no-op for a lorebook that isn't the character's embedded one. A draft PR implementing this is on the way.Template check
@SpicyMarinara commented on GitHub (Jul 7, 2026):
Pushing to staging in a second.