[GH-ISSUE #2849] [Feature]: Allow disabling a character-bound lorebook per chat #1441

Closed
opened 2026-10-21 05:35:17 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Romuromylus on GitHub (Jun 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2849

Originally assigned to: @Romuromylus on GitHub.

What problem does this solve?

A lorebook bound to a character (characterId/characterIds), or a global / active-persona book, is force-activated in every non-game chat where it applies, with no way to turn it off from the chat UI. When several present characters carry overlapping books, entries get injected redundantly and overflow the token budget ("N entries skipped by token budget").

The only existing workaround is to unbind the book globally, which removes it from every chat — too coarse, and it does not scale for group conversations where each character legitimately needs its own book elsewhere.

Proposed solution

Add a per-chat exclusion for auto-activated lorebooks:

  • Read chatMeta.excludedLorebookIds in the non-game generation / lorebook-scan / dry-run / prompt-preview paths and pass it to the relevant-lorebook filter. The server filter already honors an excludedLorebookIds set (lorebook/index.ts filterRelevantLorebooks); it was previously only ever fed the Game Lorebook Keeper's exclusions, never the user's per-chat list.
  • Surface a "disable in this chat" control on auto-activated (character/global/persona) books in the chat Lorebooks panel, and show disabled books with a re-enable affordance. Disabling suppresses the book for that chat only; it does not unbind it.

Alternatives considered

  • Unbinding the book globally — loses it in every chat.
  • Pinning the book to the chat — auto-activated books only offered a "pin" action, which adds activation rather than removing it, so there was no disable path at all.

Additional context

Detailed root-cause analysis and a working local patch were contributed by Evie [MARI] on Discord — credit to them for the diagnosis: excludedLorebookIds is honored by the server filter but never read from chat metadata on the non-game path; the client toggleLorebook() only touches activeLorebookIds; and the chat Lorebooks list only rendered a remove control for pinned books, so auto-activated books had no disable affordance. Reported against v2.0.4 (b5461ad).

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (Jun 24, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2849 Originally assigned to: @Romuromylus on GitHub. ## What problem does this solve? A lorebook bound to a character (`characterId`/`characterIds`), or a global / active-persona book, is force-activated in every non-game chat where it applies, with no way to turn it off from the chat UI. When several present characters carry overlapping books, entries get injected redundantly and overflow the token budget ("N entries skipped by token budget"). The only existing workaround is to unbind the book globally, which removes it from every chat — too coarse, and it does not scale for group conversations where each character legitimately needs its own book elsewhere. ## Proposed solution Add a per-chat exclusion for auto-activated lorebooks: - Read `chatMeta.excludedLorebookIds` in the non-game generation / lorebook-scan / dry-run / prompt-preview paths and pass it to the relevant-lorebook filter. The server filter already honors an `excludedLorebookIds` set (`lorebook/index.ts` `filterRelevantLorebooks`); it was previously only ever fed the Game Lorebook Keeper's exclusions, never the user's per-chat list. - Surface a "disable in this chat" control on auto-activated (character/global/persona) books in the chat Lorebooks panel, and show disabled books with a re-enable affordance. Disabling suppresses the book for that chat only; it does not unbind it. ## Alternatives considered - Unbinding the book globally — loses it in every chat. - Pinning the book to the chat — auto-activated books only offered a "pin" action, which adds activation rather than removing it, so there was no disable path at all. ## Additional context Detailed root-cause analysis and a working local patch were contributed by Evie [MARI] on Discord — credit to them for the diagnosis: `excludedLorebookIds` is honored by the server filter but never read from chat metadata on the non-game path; the client `toggleLorebook()` only touches `activeLorebookIds`; and the chat Lorebooks list only rendered a remove control for pinned books, so auto-activated books had no disable affordance. Reported against v2.0.4 (b5461ad). ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
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-Engine#1441
No description provided.