mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3349] [MERGED] fix(lorebooks): stop exporting linked lorebooks in native format #5891
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#5891
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3349
Author: @kolacheee
Created: 7/7/2026
Status: ✅ Merged
Merged: 7/7/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/3345-revert-linked-lorebook-export📝 Commits (2)
5488aa8fix(lorebooks): stop exporting linked lorebooks in native format (#3345)7a25a09Merge branch 'staging' into fix/3345-revert-linked-lorebook-export📊 Changes
3 files changed (+23 additions, -90 deletions)
View changed files
📝
CHANGELOG.md(+1 -1)📝
packages/server/src/routes/characters.routes.ts(+7 -53)📝
packages/server/src/services/import/marinara.importer.ts(+15 -36)📄 Description
Linked issue
Closes #3345
Why this change
#3342 made native Character/Persona export bundle every linked (assigned) lorebook and re-link it on import. Linked lorebooks are shared, standalone entities — they are not supposed to travel with a card in any format. The bundling forks a genuinely-shared lorebook into a private copy on every import (a "World Rules" book assigned to 3 characters becomes a fresh copy per imported character, while the original is untouched), and it exports an embedded lorebook twice (once as
character_book, once as the bundle — the double-count reported in #3344). Only an embedded lorebook (data.character_book) should export with a card; the intended, user-driven way to bake a lorebook in is Embed into card (#3341 / #3343). Compatible export already carried onlycharacter_book, so this restores native export to match.What changed
packages/server/src/routes/characters.routes.ts— removed the native-export lorebook bundling added in #3342: thecreateLorebooksStorageimport, theLorebooksStore/NativeLorebookBundletypes, thereadAttachedLorebooksForCharacter/readAttachedLorebooksForPersona/readLorebookBundleshelpers, thelorebooksStorageparam +Promise.allentry +lorebooksspread in both native envelope builders, the module-levellorebooksStorageconst, and all four call-site args. This file is now identical to its pre-#3342 state.packages/server/src/services/import/marinara.importer.ts— removedimportBundledLorebooksand its two call sites inimportCharacter/importPersona, plus theowner-threading inimportLorebookPayload(ownership links revert to being read from the lorebook's own exported fields, exactly as before #3342). Kept the harmlessimportLorebook → importLorebookPayloadsplit so this change stays in a different region of the function than #3347's folder-nesting fix — avoiding a needless conflict between the two PRs.characters.routes.tsthat reintroduces a module-levellorebooksStorage(+createLorebooksStorageimport). If #3345 merges first, #3343 rebases to re-add them; if #3343 merges first, #3345 keeps that const/import (still used by embed) and removes only the bundling. Called out so the merge order is intentional, not a mistake.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm --filter @marinara-engine/server lint(tsc). Fullpnpm checkis blocked on Windows by the pre-existing v2.1.0build.mjsexecPath spawn bug, unrelated to this change..marinara.jsonno longer contains a top-levellorebooksbundle; import into a fresh instance and confirm no forked standalone lorebook is created.character_book) still exports and re-imports its embedded book exactly once (no duplicate assigned row).lorebooksbundle) still imports the character/persona successfully, with the stray bundle simply ignored (no crash).Docs and release impact
CHANGELOG updated (edited the #3342 2.1.1 entry). No version bump.
UI evidence (if applicable)
N/A — server-side export/import logic; no UI change.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.