mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #245] [MERGED] fix(server): scan endpoint shouldn't skip empty chats — CONST entries activate regardless #4527
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#4527
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/245
Author: @Trade-Mottoes
Created: 4/26/2026
Status: ✅ Merged
Merged: 4/27/2026
Merged by: @LukaTheHero
Base:
main← Head:fix/lorebook-scan-skips-empty-chats📝 Commits (1)
da64de8fix(server): scan endpoint shouldn't skip empty chats — CONST entries activate regardless📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
packages/server/src/routes/lorebooks.routes.ts(+2 -1)📄 Description
The bug
Open a fresh chat that has a lorebook with CONST entries attached.
Open the Active World Info panel. It says "No active entries for
this chat" — but CONST entries activate unconditionally by definition,
they should be there. Send any message at all and they appear.
Repro:
Constant: true.Root cause
/lorebooks/scan/:chatIdhad an early return that bailed out withan empty result when
chatMessages.length === 0. The intent wasprobably "no messages → nothing can have triggered" — but that
ignores CONST, which doesn't need a trigger.
Fix
Drop the early return.
processLorebooks()already handles theempty-message case correctly: keyword-triggered entries don't fire
(nothing to match), and CONST entries activate as expected.
User-visible result
CONST entries appear in the Active World Info panel from the moment
a chat is created, matching their "always on" semantic.
Testing
pnpm lint && pnpm buildpass.the entry on first panel open, before any message is sent.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.