mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2184] [Issue]: Lorebook runtime no longer enforces max activated entry cap #1087
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#1087
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 @Promansis on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2184
Originally assigned to: @cha1latte on GitHub.
Summary
The lorebook runtime rescan found that refactor no longer applies the maximum activated lorebook entry cap during prompt-time selection. Legacy capped selected entries with
LIMITS.MAX_LOREBOOK_ENTRIES, while refactor defines the same limit but does not apply it in the active scanner.Expected behavior
Prompt-time lorebook selection should cap injected entries at
LIMITS.MAX_LOREBOOK_ENTRIESwhile preserving the existing budget priority order: constants first, fresh latest-user-message matches next, then injection order.Actual behavior
Refactor applies per-lorebook and chat token budgets, but the active scanner path does not enforce the max-entry cap. A chat with many small matching entries can inject more than the intended maximum.
Steps to reproduce
LIMITS.MAX_LOREBOOK_ENTRIESsmall entries that all activate for a chat turn.Impact area
Environment
refactorLogs, screenshots, or video
Static trace:
LIMITS.MAX_LOREBOOK_ENTRIESinsrc/engine/contracts/constants/defaults.ts.src/engine/generation/active-lorebook-scanner.tsbut does not use the max-entry limit.packages/server/src/services/lorebook/index.tsonmain.Regression notes
Legacy
mainenforcesLIMITS.MAX_LOREBOOK_ENTRIESduring selection. Refactor preserved the constant but lost enforcement in the prompt-time active scanner.Additional context
Parity row:
07-LB-RUNTIME-budget-priority.Classification from rescan:
Current refactor defect.Template check