mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1565] [MERGED] Fix lorebook prompt activation settings #5121
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#5121
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/1565
Author: @Xelvanis
Created: 5/29/2026
Status: ✅ Merged
Merged: 5/29/2026
Merged by: @Xelvanis
Base:
refactor← Head:codex/lorebook-activation📝 Commits (2)
1e79c31Fix lorebook prompt activation settingsf7e699aAddress lorebook activation failpaths📊 Changes
4 files changed (+629 additions, -52 deletions)
View changed files
📝
src/engine/generation-core/lorebooks/prompt-injector.ts(+54 -17)📝
src/engine/generation/active-lorebooks.ts(+3 -3)📝
src/engine/generation/prompt-assembly.test.ts(+341 -1)📝
src/engine/generation/prompt-assembly.ts(+231 -31)📄 Description
Linked issue
Closes #1543
Closes #1544
Closes #1545
Closes #1546
Closes #1547
Why this change
What changed
lorebook.chatIdmatches the current chat, even when the book is not pinned inactiveLorebookIds.scanDepthis inherited by entries without an entry-level override, and recursive lorebooks userecursiveScanwith the schema max depth cap.Refactor impact
Primary owner:
engine generation / generation-core lorebooks
Impact areas reviewed:
useUpdateLorebookFolder.activatedLorebookEntries.Boundary notes:
Pressure points touched:
Validation
pnpm checkpasses locallypnpm typecheckpasses locallypnpm buildpasses locallypnpm check:architecturepasses locallypnpm check:docspasses locallycargo check --manifest-path src-tauri/Cargo.toml --workspacepasses locallyManual verification notes
pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts -t "lorebook activation settings"failed 7/7 expected rows.pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts -t "lorebook activation settings"passed.pnpm exec vitest run src/engine/generation/prompt-assembly.test.tspassed.pnpm exec vitest run src/engine/generation-core/lorebooks/keyword-scanner.test.ts src/engine/generation/start-generation.test.ts src/engine/generation/runtime-records.test.ts src/engine/generation/prompt-overrides.test.ts src/engine/generation/prompt-assembly.test.ts src/engine/generation/main-tool-loop.test.ts src/engine/generation/generate-route-utils.test.ts src/engine/generation/connected-commands.test.ts src/engine/generation/agent-runner.test.tspassed.pnpm typecheckpassed.pnpm check:architecturepassed.pnpm buildpassed with the existing Vite large-chunk warning.pnpm exec vitest run src/engine/generation/prompt-assembly.test.tspassed, 50 tests.pnpm exec vitest run src/engine/generation-core/lorebooks/keyword-scanner.test.ts src/engine/generation/start-generation.test.ts src/engine/generation/runtime-records.test.ts src/engine/generation/prompt-overrides.test.ts src/engine/generation/prompt-assembly.test.ts src/engine/generation/main-tool-loop.test.ts src/engine/generation/generate-route-utils.test.ts src/engine/generation/connected-commands.test.ts src/engine/generation/agent-runner.test.tspassed, 173 tests.pnpm typecheckpassed.pnpm check:architecturepassed.pnpm buildpassed with the existing Vite large-chunk warning.Marinara Engine QAwindow launched throughpnpm tauri dev --no-watch --config scratch\tauri-qa.config.jsonagainsthttp://localhost:1420.scratch/tauri-qa-lorebook-activation.pngandscratch/tauri-window-lorebook-activation.png.Docs and release impact
README.mdCONTRIBUTING.mddocs/developer/AGENTS.mdNo
CHANGELOG.mdexists on this branch. No docs changes were made because this fixes existing prompt behavior without changing the public setup or architecture docs.UI evidence
Native Tauri QA evidence was captured from the already-running QA window after the engine prompt scenarios passed. Local artifacts: scratch/tauri-qa-lorebook-activation.png and scratch/tauri-window-lorebook-activation.png.
Summary by CodeRabbit
Refactor
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.