[GH-ISSUE #813] The Pixelforge world setup picker offers lorebook entries the chat has already switched off #418

Closed
opened 2026-10-20 17:27:22 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Sep 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/813

Originally assigned to: @SpicyMarinara, @kolacheee on GitHub.

When you set up a Pixelforge world, the "World knowledge" list offers lorebook entries - and whole lorebooks - that this chat has switched off. They look exactly like the ones that are on, "Select all" ticks them too, and nothing tells you they are off for this chat. Tick one and it is used anyway; tick an entry under a book the chat has excluded and the tick does nothing at all, with no message either way.

How to reproduce (try it yourself)

Precondition: Lorebooks -> New lorebook, name it Harbor Lore, leave it enabled. Add an entry SHRINE-LORE (key shrine, content The shrine on the cliff.) and a second entry DOCKMASTER (key dock, content The dockmaster keeps the ledger.). Leave both enabled. Do not tick Global - the default is off, and that matters for step 4.

  1. Sidebar -> New -> Game. Open Experiences and switch Pixelforge on; the Pixelforge setup body replaces the wizard's.
  2. Name the world, tick generate, and press "Begin in <name>" - but make this launch fail to finish (point the connection at an unreachable base URL, or reload the page while the button reads "Setting up…"). The chat now has a game record but its session status is still setup, which is the only state the setup screen can be re-entered from. After a launch that succeeds, the status is ready and nothing reopens the setup screen.
  3. Reopen the chat. The setup screen comes back by itself. Close it with the X and accept the "campaign was kept" toast.
  4. Chat Settings -> Lorebooks -> "Add lorebook" -> Harbor Lore. This step is required: the per-chat entry switches live behind the pencil, and the pencil is only drawn for books already active in the chat. A plain new lorebook is neither global nor pinned, so before this the section reads "No lorebooks active in this chat".
  5. Click the pencil on Harbor Lore and switch SHRINE-LORE off. The row says this switch is for this chat only; check the Lorebooks page and confirm the shared entry is still on.
  6. Reopen the chat. The setup screen shows again. Switch Experiences -> Pixelforge back on (it does not remember). Under "World knowledge", click the Harbor Lore expander.

What you'll see: SHRINE-LORE is listed with a live checkbox, identical to DOCKMASTER - no strike-through, no "off for this chat" note - and "Select all" ticks it. Tick it and launch, and the generated world is written with "The shrine on the cliff." in its lore. For the other direction, go back to Chat Settings and switch the whole Harbor Lore book off for this chat instead: the picker still lists the book and still offers its entries, but ticking them does nothing at all - the server discards every entry of a book the chat excludes, silently.

What should happen: the picker should not offer content this chat has switched off. Hide those rows, or show them greyed out with the reason, and keep "Select all" out of them.

Where it is

packages/pixelforge/src/80-setup.js at 49a9c10c, in the setup view's lorebook loader:

  • :679 - const rows = await PF.api.getJson(\/lorebooks/${encodeURIComponent(book.id)}/entries`);`
  • :686 - .filter((row) => row.enabled !== false && row.enabled !== "false")
  • :629 - if (book.enabled === false || book.enabled === "false") continue; (the book-level filter; the comment above it cites listEligibleEntriesByIds)

Both filters are in the shipped 0.16.3 bundle too (packages/pixelforge/client.js:25919 and :25976). The picker never reads the chat at all - no chatId, entryStateOverrides or excludedLorebookIds appears anywhere in the file.

What's happening

GET /lorebooks/{id}/entries is the shared, chat-blind list (Engine packages/server/src/routes/lorebooks.routes.ts:595-597 is a plain storage.listEntries(id)), so the only thing the picker can filter on is the library-wide on/off flag. The per-chat switches live elsewhere - on the chat's own metadata as entryStateOverrides and excludedLorebookIds - and the picker never looks there. The comment justifying the filter ("the server refuses one anyway") is true of the library-wide flag it filters on; it does not cover the per-chat flag, which did not exist when the picker was written. For a book the chat excludes the server does refuse, unconditionally and without a word, so those rows are controls that cannot do anything; for an entry the chat has switched off the server currently honours the tick, which is the paired Engine bug.

The window is narrow: boxes start unticked, and the setup screen is only re-enterable while the campaign's first turn has not happened, so the chat has to have been given per-chat switches before play starts.

Suggested fix

Make the picker ask the chat what it has switched off, once, when it loads. Nothing new is needed on the Engine side: the host already passes the chat id into the setup view (packages/client/src/components/game/NewGameExperienceChooser.tsx:272-279), and GET /api/chats/{chatId} already returns metadata.entryStateOverrides and metadata.excludedLorebookIds. With that in hand, drop (or render disabled, with a short reason) any entry whose override says enabled: false and any book the chat excludes, and have "Select all" work off the same filtered list. If the chat read fails, fall back to today's behaviour rather than blocking setup.

Context

The picker shipped with #749 in Pixelforge 0.16.2 and is in users' hands today as 0.16.3 (PR #761 later reworked the same lore code for context limits, unrelated to on/off state). The per-chat entry switch the picker fails to notice shipped afterwards, in Engine PR #5981 (Engine issue #5954, merged 2026-09-09) - so this is a gap a newer Engine feature opened, not a picker regression; Engine #5954 deliberately set the Pixelforge picker aside as a different subsystem. Engine #3376 is the precedent for the same class of fix on the book-level case. Filed alongside its Engine half, which is that world generation honours a ticked entry the chat has switched off.

Found by an AI-assisted sweep of the merged PRs against their original issues, then re-verified against Engine staging 52799569c on 2026-09-13. Please verify before fixing.

Related issue from the same sweep: Pasta-Devs/Marinara-Engine#6126 (the Engine world-generation half).

Originally created by @kolacheee on GitHub (Sep 13, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/813 Originally assigned to: @SpicyMarinara, @kolacheee on GitHub. When you set up a Pixelforge world, the "World knowledge" list offers lorebook entries - and whole lorebooks - that this chat has switched off. They look exactly like the ones that are on, "Select all" ticks them too, and nothing tells you they are off for this chat. Tick one and it is used anyway; tick an entry under a book the chat has excluded and the tick does nothing at all, with no message either way. ## How to reproduce (try it yourself) Precondition: Lorebooks -> New lorebook, name it `Harbor Lore`, leave it enabled. Add an entry `SHRINE-LORE` (key `shrine`, content `The shrine on the cliff.`) and a second entry `DOCKMASTER` (key `dock`, content `The dockmaster keeps the ledger.`). Leave both enabled. Do not tick Global - the default is off, and that matters for step 4. 1. Sidebar -> New -> Game. Open Experiences and switch Pixelforge on; the Pixelforge setup body replaces the wizard's. 2. Name the world, tick generate, and press "Begin in &lt;name&gt;" - but make this launch fail to finish (point the connection at an unreachable base URL, or reload the page while the button reads "Setting up…"). The chat now has a game record but its session status is still `setup`, which is the only state the setup screen can be re-entered from. After a launch that succeeds, the status is `ready` and nothing reopens the setup screen. 3. Reopen the chat. The setup screen comes back by itself. Close it with the X and accept the "campaign was kept" toast. 4. Chat Settings -> Lorebooks -> "Add lorebook" -> Harbor Lore. This step is required: the per-chat entry switches live behind the pencil, and the pencil is only drawn for books already active in the chat. A plain new lorebook is neither global nor pinned, so before this the section reads "No lorebooks active in this chat". 5. Click the pencil on Harbor Lore and switch `SHRINE-LORE` off. The row says this switch is for this chat only; check the Lorebooks page and confirm the shared entry is still on. 6. Reopen the chat. The setup screen shows again. Switch Experiences -> Pixelforge back on (it does not remember). Under "World knowledge", click the `Harbor Lore` expander. **What you'll see:** `SHRINE-LORE` is listed with a live checkbox, identical to `DOCKMASTER` - no strike-through, no "off for this chat" note - and "Select all" ticks it. Tick it and launch, and the generated world is written with "The shrine on the cliff." in its lore. For the other direction, go back to Chat Settings and switch the whole `Harbor Lore` book off for this chat instead: the picker still lists the book and still offers its entries, but ticking them does nothing at all - the server discards every entry of a book the chat excludes, silently. **What should happen:** the picker should not offer content this chat has switched off. Hide those rows, or show them greyed out with the reason, and keep "Select all" out of them. ## Where it is `packages/pixelforge/src/80-setup.js` at 49a9c10c, in the setup view's lorebook loader: - `:679` - `const rows = await PF.api.getJson(\`/lorebooks/${encodeURIComponent(book.id)}/entries\`);` - `:686` - `.filter((row) => row.enabled !== false && row.enabled !== "false")` - `:629` - `if (book.enabled === false || book.enabled === "false") continue;` (the book-level filter; the comment above it cites `listEligibleEntriesByIds`) Both filters are in the shipped 0.16.3 bundle too (`packages/pixelforge/client.js:25919` and `:25976`). The picker never reads the chat at all - no `chatId`, `entryStateOverrides` or `excludedLorebookIds` appears anywhere in the file. ## What's happening `GET /lorebooks/{id}/entries` is the shared, chat-blind list (Engine `packages/server/src/routes/lorebooks.routes.ts:595-597` is a plain `storage.listEntries(id)`), so the only thing the picker can filter on is the library-wide on/off flag. The per-chat switches live elsewhere - on the chat's own metadata as `entryStateOverrides` and `excludedLorebookIds` - and the picker never looks there. The comment justifying the filter ("the server refuses one anyway") is true of the library-wide flag it filters on; it does not cover the per-chat flag, which did not exist when the picker was written. For a book the chat excludes the server does refuse, unconditionally and without a word, so those rows are controls that cannot do anything; for an entry the chat has switched off the server currently honours the tick, which is the paired Engine bug. The window is narrow: boxes start unticked, and the setup screen is only re-enterable while the campaign's first turn has not happened, so the chat has to have been given per-chat switches before play starts. ## Suggested fix Make the picker ask the chat what it has switched off, once, when it loads. Nothing new is needed on the Engine side: the host already passes the chat id into the setup view (`packages/client/src/components/game/NewGameExperienceChooser.tsx:272-279`), and `GET /api/chats/{chatId}` already returns `metadata.entryStateOverrides` and `metadata.excludedLorebookIds`. With that in hand, drop (or render disabled, with a short reason) any entry whose override says `enabled: false` and any book the chat excludes, and have "Select all" work off the same filtered list. If the chat read fails, fall back to today's behaviour rather than blocking setup. ## Context The picker shipped with #749 in Pixelforge 0.16.2 and is in users' hands today as 0.16.3 (PR #761 later reworked the same lore code for context limits, unrelated to on/off state). The per-chat entry switch the picker fails to notice shipped afterwards, in Engine PR #5981 (Engine issue #5954, merged 2026-09-09) - so this is a gap a newer Engine feature opened, not a picker regression; Engine #5954 deliberately set the Pixelforge picker aside as a different subsystem. Engine #3376 is the precedent for the same class of fix on the book-level case. Filed alongside its Engine half, which is that world generation honours a ticked entry the chat has switched off. Found by an AI-assisted sweep of the merged PRs against their original issues, then re-verified against Engine staging 52799569c on 2026-09-13. Please verify before fixing. Related issue from the same sweep: Pasta-Devs/Marinara-Engine#6126 (the Engine world-generation half).
Author
Owner

@SpicyMarinara commented on GitHub (Sep 13, 2026):

SpicyMarinara/Codex is handling this assigned issue in the release sweep, draft PR #836. We are checking the existing linked work before changing the owning package source, preserving the separate Slurp2 work in #816, and will close this issue only once its fix and validation are on staging.

<!-- gh-comment-id:5653121432 --> @SpicyMarinara commented on GitHub (Sep 13, 2026): SpicyMarinara/Codex is handling this assigned issue in the release sweep, draft PR #836. We are checking the existing linked work before changing the owning package source, preserving the separate Slurp2 work in #816, and will close this issue only once its fix and validation are on staging.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#418
No description provided.