mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #837] [Issue]: Lorebook depth 0 entries show as active but are not injected into prompts #404
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#404
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 (May 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/837
Summary
A Discord forum report describes Lorebook / World Info entries that activate correctly and appear in the Active World Info UI, but are omitted from the final prompt when the entry uses depth injection with
depth: 0.Local source inspection supports the report: depth-based lorebook entries are filtered with
a.entry.depth > 0, so activated depth-0 entries never reachinjectAtDeptheven though the injector documents depth 0 as valid.Expected behavior
When a Lorebook entry is activated and configured for depth injection at
depth: 0, it should be injected into the generated prompt at the documented depth-0 position.Changing the same entry from
depth: 0todepth: 1should only change placement, not whether the entry is injected at all.Actual behavior
The entry appears in Active World Info, but the final prompt inspected through Settings -> Advanced -> Debug Mode does not include the entry when
depth: 0.Changing the same entry to
depth: 1causes it to appear in the final prompt.Steps to reproduce
position: 2) withdepth: 0.depth: 1, trigger it again, and confirm it is injected.Environment
Marinara-Engine-Installer-1.5.9.exe)Logs, screenshots, or video
Reported verification source:
depth: 0.depth: 1.Additional context
Code trail from local investigation:
packages/shared/src/schemas/lorebook.schema.tsallowsdepthvalues down to 0:depth: z.number().int().min(0).default(4)packages/server/src/services/lorebook/prompt-injector.tsdocuments depth 0 as valid:Depth 0 = after the last message, depth 1 = before the last message, etc.injectAtDepthcan already place depth-0 injections withresult.length - depth.getDepthInjectedEntriescurrently excludes lorebook entries at depth 0:.filter((a) => a.entry.position >= 2 && a.entry.depth > 0)injectAtDepth(... depth: 0 ...)for pre-generation agent context, which suggests the shared injector supports this case.Likely fix direction: change the depth-entry filter to include
depth >= 0, and add focused coverage soprocessActivatedEntriesreturns depth-0 entries andinjectAtDepthplaces them as documented.Related historical issue: #27 was a broader closed lorebook activation report, but this appears to be a distinct, narrower depth-0 injection bug.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: