mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7279] [MERGED] fix(memory): recall message excerpts from scenes with private sections #7659
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#7659
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/7279
Author: @SpicyMarinara
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/excerpts-from-private-scenes📝 Commits (5)
572039afix(memory): recall message excerpts from scenes with private sections5ecbec9Merge origin/staging into fix/excerpts-from-private-scenes17ec347Merge origin/staging into fix/excerpts-from-private-scenesb417056Merge origin/staging into fix/excerpts-from-private-scenes1382cf4Merge origin/staging into fix/excerpts-from-private-scenes📊 Changes
8 files changed (+169 additions, -47 deletions)
View changed files
📝
CHANGELOG.md(+2 -1)📝
docs/agents/memory.md(+4 -4)📝
packages/client/src/components/chat/AdvancedMemoryInspector.tsx(+0 -1)📝
packages/client/src/localization/locales/en.json(+0 -1)📝
packages/server/src/services/advanced-memory.ts(+16 -24)📝
scripts/regressions/advanced-memory-audience.regression.ts(+117 -9)📝
scripts/regressions/advanced-memory-decisions.regression.ts(+14 -4)📝
scripts/regressions/advanced-memory-summary.regression.ts(+16 -3)📄 Description
Linked issue
Refs #7269 (follow-up to #7277, which merged while this was being built)
Why this change
Mari, testing Advanced Memory Recall with the Decision model (Jev) on: "only Scene Summaries get included but never message excerpts. Not even if context size allows for it."
#7277 fixed excerpt sizing and added receipt reasons. Its investigation found the bigger cause:
canRecallExcerptinpackages/server/src/services/advanced-memory.tswithheld excerpts from every scene whose summary has a{{#if char == "Name"}}section, unless the narrator alone was reading. In group chats, the helper writes such a section in almost every summary, so excerpts almost never appeared. The narrator-only rule was a deliberate shortcut, documented indocs/agents/memory.mdand pinned by three regressions.Maintainer decision (Mari, 2026-10-08)
Mari chose "Allow if they saw the messages": excerpts may come from any scene a character remembers, but they use only the messages that weren't hidden from that character, which is exactly what they saw in the chat at the time, so nothing new is revealed. Private summary sections keep rendering per character, as now. This replaces the old rule, so the regression assertions that encode "no excerpts from conditional recaps" are updated (listed below). Every other privacy assertion is kept.
One consequence to be aware of: in a chat that switches point of view without hiding messages, a character's excerpt can now quote the other POV's lines, because those messages were visible to them. Hiding a message from a character (per-character Hide from AI, or Automatic message visibility) is what keeps it out of their memory.
What changed
packages/server/src/services/advanced-memory.ts:canRecallExcerpt. A summary's private sections no longer gate the scene's excerpt or the Decision model's message pass.sceneSource, which is the reader's eligible messages (not hidden from that reader and inside their knowledge range; in a merged group, readable by every character named as remembering the scene), indexed, and not excluded. Excerpt text comes frommessageText, which renders the message body and readable attachments only. Whispers live inextra.roleplayCommandActivity(#7191), and user whisper tags are stripped from content on load, so whisper text never reaches an excerpt for anyone.excerpt-private-scenereceipt reason (added in #7277). Theexcerpt-no-roomandexcerpt-no-sourcereasons stay.scene-timeframe-constants-v22) so swipes of replies prepared under the old rule recall again instead of reusing a snapshot with no excerpts. #7237 bumped it for the same kind of change.AdvancedMemoryInspector.tsx/en.json: removed theexcerptPrivateScenereason key. #7277 introduced it and it never shipped in a release, so no saved receipt can carry it.docs/agents/memory.md: replaced the narrator-only excerpt sentences (Optional Decision model, While chatting) with the new rule, dropped the private-scene reason from Moving context, and added that a merged group's excerpt quotes only what every character who remembers the scene saw.CHANGELOG.md: new[Unreleased]entry. Also removed the private-scene reason from the #7277 entry.Updated assertions (authorized by Mari's decision)
Each of these asserted that a recap with a character condition gives a non-narrator no excerpt. Each now asserts the new rule: the excerpt holds exactly the messages that reader saw.
advanced-memory-decisions.regression.ts[]), Decision requests never contain "Cobalt refuge" (the reader's own message), receipt hasexcerpt-private-scene[#4], which the reader saw. Decision requests and the prompt still never containCONDITION_SECRETorPRIVATE_SECRET(hidden from the reader). Noexcerpt-*reason and no diagnostics notesadvanced-memory-summary.regression.ts[]for each POV)advanced-memory-summary.regression.ts[])advanced-memory-audience.regression.tsMAUKIE_PRIVATE]$) and "raw excerpts still come only from scenes without private sections"advanced-memory-audience.regression.tsadvanced-memory-audience.regression.tsMAUKIE_PRIVATE$)DUO_NARRATOR), now followed by an excerptadvanced-memory-audience.regression.tsMAUKIE_PRIVATEstill reaches only MaukieKept unchanged: every assertion that a hidden message, another character's summary section, a narrator-only section or
PRIVATE_SECRET/CONDITION_SECRETstays out, including!recalledMessageIds.includes(<message hidden from the borrower>)and the exclusion and merged-reader checks.New regressions (fail on the pre-change code)
advanced-memory-summary.regression.ts, individual group chat whose summary has a Pantalone-only section: each reader's excerpt is exactly the scene messages they saw. The ledger message hidden from the borrower stays out of his.advanced-memory-audience.regression.ts, "Private-section excerpts": a scene with a Maukie-only summary section, one message hidden from Pantalone, a user whisper to Maukie (raw tag plus saved activity) and a character whisper to Maukie.#1,#3). The private marker stays and no whisper text appears.On the pre-change service, the new excerpt assertions fail: individual Maukie and Pantalone, merged, and one-character. The new summary-file assertion expects excerpts where the old code gave
[]. The whisper and narrator assertions pass both before and after: excerpts never rendered whispers, and the narrator already got excerpts. They guard against regressions.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands the agent ran (results for the reviewer to confirm, not ticked boxes):
pnpm check: exit 0.node ./scripts/run-regressions.mjs --filter advanced-memory: 15/15 passed.--filter memory-recall5/5,--filter summary5/5,--filter whisper2/2 (roleplay-whisper-generation,roleplay-whisper-hidden-recipient),roleplay-user-private-memory1/1,native-export-memory1/1.pnpm regression:prompt: 3/3 passed.pnpm localization:check: exit 0.pnpm check,--filter advanced-memory(15/15),memory-recall(5/5),whisper(2/2),roleplay-user-private-memory(1/1) andpnpm regression:promptonb41705671, after staging (#7275, #7278) was merged in. All passed.17ec347e5and the thread is resolved.Manual verification notes
{{#if char == "Name"}}part, open Peek Prompt and check the recalled scene has an Excerpt under its summary.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/agents/memory.mdandCHANGELOG.md[Unreleased]are updated. Translation follow-up: added the new sentences to the open #7276.UI evidence (if applicable)
One receipt line removed; no layout or colour change.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.