mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8794] [MERGED] fix(memory): bound Advanced Memory's parsed-extras cache; keep manual hides when a summary that hid nothing is deleted #8807
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#8807
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/8794
Author: @SpicyMarinara
Created: 11/3/2026
Status: ✅ Merged
Merged: 11/3/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/memory-summary-hides-cache📝 Commits (2)
1dc3533fix(memory): keep parsed message extras for only the last few chats4c7fad2fix(summary): deleting a summary that hid nothing keeps manual hides📊 Changes
5 files changed (+128 additions, -25 deletions)
View changed files
📝
packages/server/src/routes/chats.routes.ts(+3 -1)📝
packages/server/src/services/advanced-memory.ts(+12 -3)📝
packages/shared/src/utils/chat-summary-entries.ts(+7 -2)📝
scripts/regressions/advanced-memory-prepare-scale.regression.ts(+40 -19)➕
scripts/regressions/summary-delete-manual-hide.regression.ts(+66 -0)📄 Description
Linked issue
Closes #8793
Why this change
Two problems found in release-prep auditing, both re-checked on staging
aed5e3578d.(1) The two Advanced Memory route services live for the whole server process. Each kept a parsed copy of every message extra for every Roleplay/Game chat it ever read, with no limit. Opening Chat Settings on a Roleplay or Game chat is enough to fill it, even with Advanced Memory off. A deleted chat stayed cached until restart. On SteamOS and Termux the cache also kept chats that the MARINARA_MAX_RESIDENT_CHATS cap had already evicted.
(2) A summary saved with "Hide summarised messages" off records which messages it covers, but no list of messages it hid. Deleting it fell back to the covered list and showed every covered message to the model again. That includes messages the user later hid by hand with the eye toggle or /hide. Branching inside such a summary did the same to the copied messages. Turning the hide setting off already showed only what the summary hid, so delete and branch were the odd ones out.
No linked issue exists. One should be opened before the PR is submitted.
What changed
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Agent-run checks (for reference; each regression was shown to fail without its fix):
node ./scripts/pnpm-runner.mjs build:shared: succeeded; rebuilt again after every stash/pop so shared dist matches the fixed sourcenode ./scripts/run-regressions.mjs --filter summary-delete-manual-hide (fixed / both stashed / each half stashed): PASSED with fix; FAILED with each revert, each on its own assertionnode ./scripts/run-regressions.mjs --filter advanced-memory-prepare-scale (fixed / stashed / FIFO variant): PASSED with fix; FAILED on the eviction assertion without the fix; FAILED on the re-read assertion with FIFOnode ./scripts/run-regressions.mjs --filter advanced-memory: 23/23 passednode ./scripts/run-regressions.mjs --filter summary: 10/10 passed (includes the new regression)node ./scripts/run-regressions.mjs --filter issue-sweep-5391: 1/1 passednode ./scripts/run-regressions.mjs --filter chat-branch: 4/4 passednode ./scripts/run-regressions.mjs --filter profile-apply-hide-summarised / roleplay-commands / data-integrity-bulk-hidden / merged-chat-summary / roleplay-user: 1/1 passed eachnode ./scripts/run-regressions.mjs --filter memory-recall: 7/7 passednode ./scripts/pnpm-runner.mjs --filter @marinara-engine/shared lint (generate-feature-registries + tsc --noEmit): exit 0node ./scripts/pnpm-runner.mjs --filter @marinara-engine/server lint (tsc -b ../shared && tsc --noEmit && regressions character-activity tsconfig): exit 0npx prettier --write, then npx prettier --check on all 5 changed files: All matched files use Prettier code styleIndependent adversarial review: approve.
Known limits and risks:
Low. (1) Cache: a miss only costs a JSON re-parse, so a working set of more than 4 chats per service, for example generating in more than 4 Advanced Memory chats at once, just re-parses more often. Correctness is unchanged. A deleted chat's entry stays until 4 other chats are read on that service; this is marked with a ponytail: comment. (2) Summary: legacy entries saved before hiddenMessageIds existed, which hid all their messageIds client-side, no longer unhide on delete or branch drop, so those messages stay hidden until unhidden by hand. That is the conservative failure direction: nothing hidden is exposed. Retained entries still use the messageIds fallback to protect coverage. Not done here: the relayed user request about Otome Hearth outfit affection (+20 to +5). It is outside this worktree and, under AGENTS.md routing, belongs in the Marinara-Agents package repo, so it still needs separate handling. Nothing was pushed and no PR was opened, per the task rules.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.