mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3375] [Issue]: 'Remove from chat' on a lorebook that's also active via persona/character/global only unpins it — it keeps injecting, and 'Disable in this chat' is hidden while pinned #1823
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#1823
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 (Jul 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3375
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
In Chat Settings → Lorebooks, each active lorebook row has a single action button with three mutually-exclusive states. For a book that is both pinned to the chat and also active via a persona (or character/global) link, the row shows only the 🗑️ "Remove from chat" button — not the 👁️ "Disable in this chat" button. Clicking "Remove from chat" only removes the chat pin; the book keeps injecting because the persona link still activates it. There is no single action that fully turns the book off, and "Remove from chat" reads as "this book is gone" when it isn't.
This is the likely cause of the user report "I unlinked lorebook A from the chat and it still behaved like it had read A." Unlinking (Remove from chat) does not stop a persona-linked book — only the separate "Disable in this chat" (👁️, which writes the per-chat exclusion) does. And that eye is hidden while the book is pinned, so the user has to: click trash → not realize the book is still active → later spot the "Persona" pill → click the now-appeared eye.
(To be clear about scope: the row already shows why a book is active via small pills — "Chat", "Persona", "Character", "Global" — so the persona activation is not invisible; and the injection gate itself works correctly. The gap is purely this confusing two-step control and the misleading "Remove from chat" label for a book kept alive by another source.)
How to reproduce (try it yourself)
You'll see: the pin is removed, but the book is still listed as active (now just the "Persona" pill) and still injects — and the button silently changes to a 👁️ "Disable in this chat". Nothing told you it was still active.
Expected: one clear way to fully turn a book off for this chat — or, at minimum, after "Remove from chat" on a still-active book, a signal that it's still active via the persona and how to disable it.
Where it is
packages/client/src/features/chat-settings/sections/LorebooksSection.tsx:127-151— the per-row control:isExcluded→ 👁️ "Enable in this chat" (onSetLorebookExcluded(id, false)), lines 127-134isPinned→ 🗑️ "Remove from chat" (onToggleLorebook(id), unpin only), lines 135-142onSetLorebookExcluded(id, true)), lines 143-150Because the
isPinnedbranch wins over the exclude branch, a pinned + persona-active book never shows the disable control. The "why" pills are rendered at 110-125 (lorebook.activeReasons). Unpin writesactiveLorebookIds; disable writesexcludedLorebookIds(ChatSettingsDrawer.tsxsetLorebookExcluded~2387). The server injection gate honorsexcludedLorebookIdscorrectly (packages/server/src/services/lorebook/index.ts:246, dropped before the persona check), so "Disable in this chat" genuinely stops injection in every mode — it's just hard to reach for a pinned book.What's happening
The single-button, three-way design assumes a book is either pinned, excluded, or auto-active — not pinned and auto-active-via-another-source at once. So it offers "Remove from chat" (unpin) but hides "Disable in this chat" (exclude) for exactly the case where unpinning alone doesn't stop injection.
Suggested fix
For a book active via a non-chat source (persona/character/global), make the full-disable reachable in one step: show the 👁️ "Disable in this chat" control even when the book is pinned (e.g. render both a "Remove pin" and a "Disable" action, or make a single "Disable in this chat" that also clears the pin by adding to
excludedLorebookIds). At minimum, after "Remove from chat" on a book still active via another source, surface an inline hint — "Still active via persona — Disable in this chat?" — wired tosetLorebookExcluded. No server change needed; the exclusion gate already works.AI-investigated against the current tree (v2.0.9); the control branches, the reason pills, and the server exclusion gate all read and confirmed. Please verify before fixing.
@SpicyMarinara commented on GitHub (Jul 8, 2026):
Addressed in #3388 and merged to staging.