mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7203] [MERGED] fix(memory): keep scene audiences, honest recall receipts and fresh recall on swipes #7619
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#7619
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/7203
Author: @SpicyMarinara
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/memory-recall-followups-7184📝 Commits (10+)
ff81293fix(memory): keep scene audiences, honest recall receipts and fresh recall on swipese8620bffix(memory): treat a null audience as missing and move past failed older-scene checksaa52e96Merge remote-tracking branch 'origin/staging' into fix/memory-recall-followups-7184d7e438fdocs(memory): say no earlier scenes were available, not that none were savedb260792docs(changelog): limit the swipe note to scenes the character could recall2f55ee6fix(memory): keep loose participant names away from the user's persona and other characters5c20fadMerge remote-tracking branch 'origin/staging' into fix/memory-recall-followups-7184b05bc6afix(memory): hash the same timeline-enriched scenes when validating a swipe6abb5d5Merge remote-tracking branch 'origin/staging' into fix/memory-recall-followups-7184c3c6bc0docs(changelog): shorten the Advanced Memory follow-ups entry (#7184)📊 Changes
11 files changed (+653 additions, -55 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/agents/memory.md(+4 -2)📝
packages/client/src/components/chat/AdvancedMemoryInspector.tsx(+20 -6)📝
packages/client/src/components/chat/AdvancedMemorySettings.tsx(+1 -0)📝
packages/client/src/localization/locales/en.json(+4 -0)📝
packages/server/src/services/advanced-memory.ts(+205 -45)📝
packages/server/src/services/generation/advanced-memory-context.ts(+6 -2)📝
packages/shared/src/types/advanced-memory.ts(+4 -0)📝
scripts/regressions/advanced-memory-audience.regression.ts(+4 -0)➕
scripts/regressions/advanced-memory-recall-followups.regression.ts(+402 -0)📝
scripts/regressions/advanced-memory-recovery.regression.ts(+2 -0)📄 Description
Linked issue
Closes #7184
Why this change
While fixing #7182, four Advanced Memory recall problems were reproduced. They lose memories silently or make the recall receipt misleading:
audiencekey, the scene was saved as narrator-only with no warning. In a 1:1 chat that scene could never be recalled for the character, and the Decision model was never asked.decision-recallso it no longer claims a selection; this builds on that.)What changed
advanced-memory.ts): the helper's names match by ID, then by full name (case and punctuation ignored), then by a unique partial name. A partial name can be shorter ("Kaito" for "Kaito Nakamura"), or longer when it starts with the card's full name ("Pantalone Bisognosi" for "Pantalone").audiencekey ornullis a format slip. In a chat with one character it keeps that character. With several characters it cannot be guessed, so the scene stays narrator-only, asadvanced-memory-audience.regression.tsrequires ("missing audience is narrator-only, including a user-only scene"). Any other shape is flagged and grants nothing.scene-audience-unmatcheddependency (shared constant). The mark shows a status warning in the Advanced Memory drawer and enables the existing review and save flow in Access memories, with its own help text. Saving the scene's access clears the mark.no-recall-candidates: no earlier scene this character can recall.no-recall-budget: no room, or relevant scenes did not fit.no-relevant-recall: candidates were judged and none fit.archiveRevision, a hash of the finished scenes outside the reply's live messages that this audience could recall.validatePreparedchecks it only for a swipe's cached snapshot, using the same scene set as preparation. A scene saved after the reply within its live messages cannot be recalled yet, so a plain swipe still reuses its memory and makes no extra Decision calls. Generation-time validation is unchanged. Snapshots saved before this change recall once more, then are reused.closedOnly) runs the participant check for up to three older scenes per run (ponytail:constant). A failed check there is logged and marks the scene, so it never blocks archiving the scene that just ended, and later runs move on to other scenes. Prepare existing history still checks all of them and retries failed ones.recordRevision()replaces two copies of the same revision hash, and the persona list reuses #7192'sspeakerName().en.json, plusdocs/agents/memory.mdand the CHANGELOG.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAutomated runs by the agents (the boxes above are left for the human reviewer). All runs were on the final head, which includes staging with #7191 and #7192:
pnpm check: passed.node scripts/run-regressions.mjs --filter memory: 20/20 passed. This includes the newadvanced-memory-recall-followups.regression.ts, #7192'sadvanced-memory-visibility.regression.tsand every existing Advanced Memory regression.playwright test e2e/advanced-memory.e2e.ts --project=desktop-chromium: 17/17 passed.roleplay-regeneration-context,chat-branch-lineage,roleplay-interrupt-generation, the tworoleplay-whisperregressions andpnpm regression:prompt.staging's code. Run against the first version of this PR, its persona, description, object, odd-shape, plain-swipe and recall-off checks failed.advanced-memory-audience.regression.tsnow also checks for the new warning.advanced-memory-recovery.regression.tsnow also covers "Pantalone Bisognosi" → Pantalone and the narrator's partial name "Powers" → narrator-only. No existing assertion was changed or removed.nullaudiences, repeatedly failing older-scene checks, and translated docs (follow-up #7204).Manual verification notes
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Changed:
CHANGELOG.md([Unreleased]) anddocs/agents/memory.md, which now covers participant matching and the persona and description rules, older-scene checks, swipe refresh limited to scenes outside the chat history, and receipt reasons. Translation follow-up: #7204. No version or storage-format change. Receipts only gain an optional field, and old snapshots stay readable.Known conflict, kept on purpose: the issue asks that a missing
audiencekey never mean "nobody". An existing regression treats it as narrator-only in group chats, so a group keeps that rule but is now flagged rather than silent. Only one-character chats assume the character was present. If you want group chats to guess too, that test's decision needs changing first.Follow-up worth considering: #7192 added its own
characterIdsNamed()for visibility answers (exact name, else a unique first name). It does not consider personas. Sharing one matcher would keep the two rules aligned, but changing #7192's visibility behaviour is outside this PR.UI evidence (if applicable)
No layout changes: two new receipt lines, one drawer warning and one help line, all reusing existing components.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.