mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6701] [MERGED] feat(lorebooks): optionally search character context #7290
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#7290
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/6701
Author: @SpicyMarinara
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @SpicyMarinara
Base:
staging← Head:codex/lorebook-character-context-6670📝 Commits (4)
6da0010feat(lorebooks): add opt-in character-context setting6ecc310feat(lorebooks): score character context in the existing query batch1ef8ee2test(lorebooks): cover calibration and missing character contexta933c20Merge remote-tracking branch 'origin/staging' into codex/lorebook-character-context-6670📊 Changes
22 files changed (+244 additions, -21 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)➕
e2e/lorebook-character-context.e2e.ts(+60 -0)📝
packages/client/src/components/lorebooks/LorebookEditor.tsx(+20 -0)📝
packages/client/src/lib/lorebook-duplicate.ts(+1 -0)📝
packages/client/src/localization/locales/en.json(+3 -1)📝
packages/server/src/db/schema/lorebooks.ts(+1 -0)📝
packages/server/src/routes/backup.routes.ts(+1 -0)📝
packages/server/src/routes/generate.routes.ts(+1 -1)📝
packages/server/src/routes/lorebooks.routes.ts(+1 -1)📝
packages/server/src/services/generation/agent-lorebook-triggers.ts(+1 -1)📝
packages/server/src/services/import/marinara.importer.ts(+1 -0)📝
packages/server/src/services/lorebook/embeddings.ts(+31 -7)📝
packages/server/src/services/lorebook/index.ts(+1 -1)📝
packages/server/src/services/lorebook/keyword-scanner.ts(+8 -6)📝
packages/server/src/services/mari-db/mari-db.service.ts(+13 -1)📝
packages/server/src/services/prompt/assembler.ts(+1 -1)📝
packages/server/src/services/prompt/marker-expander.ts(+1 -1)📝
packages/server/src/services/storage/lorebooks.storage.ts(+4 -0)📝
packages/shared/src/schemas/lorebook.schema.ts(+1 -0)📝
packages/shared/src/types/lorebook.ts(+2 -0)...and 2 more files
📄 Description
Linked issue
Closes #6670
Why this change
A character can introduce a scene detail that a short user reply does not repeat. User-only lorebook vectors miss those details. The opt-in Include character context setting scores recent character replies separately and retains the higher match, preserving the existing user query and user-only defaults.
What changed
Validation
Passed
pnpm check, the fullpnpm regression:promptcommand, the lorebook decision/round-trip regression, seven UI smoke cases and three save/reload/duplication cases across desktop Chromium, mobile Chromium and mobile WebKit. Inspected light desktop and dark mobile screenshots.The regression proves the “Are you okay?” character-context example, unchanged default matching, preservation of user matches, separate role depth, compatible-vector selection and a single shared embedding call. No live paid embedding endpoint was used.
Local CodeRabbit completed with one request for additional regression coverage. Added explicit calibration-isolation and no-character-message fallback assertions, then reran the full prompt regression command. Rechecked the integrated branch with
pnpm checkafter merging current staging. No findings were dismissed.Docs and release impact
Unreleased changelog entry and in-app explanation included. No version bump or docs-tree changes.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.