mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6126] Generating a game world uses lorebook entries you switched off for that chat #3404
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#3404
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 @kolacheee on GitHub (Sep 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6126
Originally assigned to: @SpicyMarinara on GitHub.
Switching a lorebook entry off for a single chat - the switch whose tooltip reads "Only affects this chat" - keeps that entry out of ordinary messages, but world generation ignores it completely. The entry's full text is still written into the prompt that creates the world, so the thing you turned off turns up in the world you get. The chat's book-level switch is respected on the same request; only the per-entry switch is ignored.
How to reproduce (try it yourself)
You need a Game Mode chat whose first world generation did not finish. That is the only window in which the per-chat switch can be set before the world call runs, because the setup screen covers Chat Settings while it is open, and closing setup on a brand-new chat deletes the chat.
The Shrine of Ash stands on the eastern ridge.It has to be Constant: this scan runs with no messages, so keyword-only entries never fire here.What you'll see: the Shrine of Ash is in the generated world. Its text went into the world-generation prompt.
What should happen: an entry you switched off for this chat should be left out of the world-generation prompt, exactly as it is left out of every ordinary message in that same chat.
Worth doing in the same sitting, because it shows this is one specific gap and not a general rule: instead of the per-entry switch, use the book-level exclude control in that same Lorebooks section and run it again. The whole book is correctly kept out of the world prompt. Adjacent controls, the same saved chat settings, opposite treatment.
The same leak happens on the Pixelforge path, at a second call:
setup, which is what lets you back into the setup screen.What you'll see: the stored selection is re-sent as-is and the entry you just turned off is back in the world's lore. The picker also still offers chat-disabled entries, unmarked.
Where it is
At staging
52799569c,packages/server/src/routes/game.routes.tsbuilds twoprocessLorebooksoption bags and neither passesentryStateOverrides:POST /setuphandler; the resulting lore text goes straight into the setup system prompt at line 6775.POST /:chatId/experience-generation(Pixelforge world writing). That bag passesforcedEntryIds,forcedEntriesOnly,ignoreForcedEntryProbability,generationTriggers: ["game_setup", "game"]andexcludedLorebookIdsfromresolveLorebookScopeExclusions("game", meta)- but noentryStateOverrides.grep -c entryStateOverrides packages/server/src/routes/game.routes.tsreturns 0; nine other server files read it. The filter that would drop the entry ispackages/server/src/services/lorebook/index.ts:1122-1141, and it only runs when the caller passes the option - there is no fallback that reads the chat itself. For contrast, the turn path passes both together (packages/server/src/routes/generate.routes.ts:2798and:2806). The switch is written byPATCH /:id/lorebook-entries/:entryIdinpackages/server/src/routes/chats.routes.ts:1363-1387.What's happening
The per-chat disable is stored on the chat as
metadata.entryStateOverrides. The lorebook assembler applies it only if the caller hands it over. Both world-generation call sites hand over the chat's book-level exclusions but not the entry-level ones, so the chat's book-level scope is honoured on exactly the same request that ignores its entry-level scope. Nothing needs to trigger it - a Constant entry gets in on its own. A probe replaying this route's own option bag activated the chat-disabled entry and put its text in the lore block; addingentryStateOverridesto the same bag dropped it.Suggested fix
Resolve the chat's
entryStateOverridesnext toresolveLorebookScopeExclusionsand pass it into bothprocessLorebookscalls in this route, the same way the chats, generate, prompts, lorebooks and dry-run routes already do. The filter runs before the forced-entry list is rebuilt, so the single added option also covers the Pixelforge "entries the player ticked" path. If the two scopes are ever meant to diverge, make that a named, documented option on the call rather than an omission. Worth a regression that pins the world-generation option bag against the turn path's, since this is the second per-chat scope to go missing on this route.That leaves one product call, on the Pixelforge path only: a player can tick, in the world-setup picker, an entry they had switched off for that chat. Either the standing chat disable wins or the explicit tick wins, but the current behaviour is neither - the picker offers such entries with no marking, because the package can only see the global on/off column. Whichever rule you choose, this route still has to read
entryStateOverrides, so the picker can be told what it is overriding. The picker half is filed separately against Marinara-Agents.Context
PR #5981 (for issue #5954, merged 2026-09-09) added the "Only affects this chat" switch and the route that stores it, but did not touch
game.routes.ts; before it merged the per-chat disable had no working writer, so nobody could reach this gap, and #5954 explicitly scoped itself away from the Pixelforge setup picker. The two world-generation option bags came from PRs #5944 and #5977, with #5942 adding the ticked-entry plumbing at the experience-generation call - all before the switch existed, so this is an omission nobody ruled on rather than a decision. Not to be confused with #3376, which was the book-level exclusion doing the same thing on this very route; that one is fixed and still works correctly. Unreleased on staging - the switch that makes this reachable landed after v2.4.4 (tagged 2026-08-25).Found by an AI-assisted sweep of merged PR #5981 against issue #5954, then re-verified against staging
52799569con 2026-09-13. Please verify before fixing.Related issue from the same sweep: Pasta-Devs/Marinara-Agents#813 (the Pixelforge picker half).
@SpicyMarinara commented on GitHub (Sep 13, 2026):
@SpicyMarinara is taking this report through the issue sweep in draft PR #6137, with Codex assisting. The affected current-code path has been checked; implementation and focused regression verification are in progress.
@SpicyMarinara commented on GitHub (Sep 13, 2026):
Fixed in #6137, now merged to staging (
e044997a2). World generation respects canonical and legacy chat-local disabled lore-entry state.