mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7407] [Issue]: Professor Mari's lorebook.entries ignores offset, so entries past the first page are unreachable #4128
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#4128
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 @bahaynes on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7407
Originally assigned to: @SpicyMarinara on GitHub.
Summary
app_datalorebook.entriesacceptslimitbut never readsoffset, and it returns a bare array with nototalornextOffset. On a large lorebook Mari gets the same first page every time she asks for "the rest", so she cannot see, review, or edit entries beyond it.instruction.listandskill.listwere already paged for this exact reason;lorebook.entrieswas left out.Expected behavior
lorebook.entriespages likeinstruction.list: it honorsoffsetand returns{ items, total, offset, nextOffset }, with a page size that keeps the result underMARI_READ_OUTPUT_BUDGET, so Mari can walk every entry of any lorebook.Actual behavior
packages/server/src/services/mari-db/mari-db.service.ts,executeLorebookAction→case "entries"(line 3718 onb19bfbd9f):With 190 entries (the lorebook this was found on):
lorebook.entries {}lorebook.entries { offset: 100 }lorebook.entries { limit: 50, offset: 150 }The default page is also more than twice the 24k read budget, so in a real run the tail of even the first page is cut before Mari sees it. The
instruction.listcomment (line ~3536) describes the same hazard: an unbounded list "hid[es] every id and mak[es] the tail unfetchable".Steps to reproduce
Save as
scripts/regressions/mari/repro-lorebook-entries-offset.regression.tsand runnode ./scripts/run-regressions.mjs --filter scripts/regressions/mari/repro-lorebook-entries-offset.regression.ts:Output on
stagingb19bfbd9f: every call starts atSession 1.Environment
stagingatb19bfbd9f)Logs, screenshots, or video
See the table above; reproduced with the script against the current
stagingtip.Additional context
Suggested direction, mirroring
instruction.listandskill.list:offsetwithnormalizeOffset, return{ items, total, offset, nextOffset }, and size the page so its pretty-printed form stays underMARI_READ_OUTPUT_BUDGET.app_datatool description and the lorebook guidance inMARI_SYSTEM_PROMPT("call it again withoffset: nextOffset").We carry a fix in a fork. It is available as a reference if useful.
Template check
@SpicyMarinara commented on GitHub (Oct 11, 2026):
Working on this in branch fix/mari-lorebook-entries-offset (Claude Code agent for @SpicyMarinara).
@SpicyMarinara commented on GitHub (Oct 11, 2026):
Fixed on staging by #7413.
lorebook.entriesnow honorsoffsetand returns{ items, total, offset, nextOffset }in pages that fit the read budget. Professor Mari is told to keep paging untilnextOffsetis null, andmari lorebooks entries --offsetpages the same way. Thanks for the detailed report and repro, @bahaynes!