mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8837] [MERGED] fix(memory): compact continuity summaries to half their size with just the combine prompt #8834
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#8834
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/8837
Author: @SpicyMarinara
Created: 11/4/2026
Status: ✅ Merged
Merged: 11/5/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/memory-compaction-halves📝 Commits (4)
63bc65ffix(memory): compact continuity summaries to half their size with just the combine prompt95f35c8docs(memory): say when a skipped continuity update is sent againdbfdf55fix(memory): save compacted sections a common phrase matched, and send each reader set once4fbffecMerge remote-tracking branch 'origin/staging' into fix/memory-compaction-halves📊 Changes
6 files changed (+795 additions, -391 deletions)
View changed files
📝
docs/agents/memory.md(+4 -2)📝
packages/server/src/services/advanced-memory.ts(+305 -159)➕
scripts/regressions/advanced-memory-compaction.regression.ts(+326 -0)📝
scripts/regressions/advanced-memory-fix.regression.ts(+4 -4)📝
scripts/regressions/advanced-memory-post-generation.regression.ts(+155 -225)📝
scripts/regressions/advanced-memory-summary-order.regression.ts(+1 -1)📄 Description
Linked issue
Closes #8820
Why this change
Issue #8820: Updating continuity sent constant summaries through the scene-summary path. That request stacked the knowledge instruction, the scene prompt, the historical-recap rules and a soft budget-proportional target, with an output allowance of at least 8,196 tokens and up to 12 rewrite passes. The target changed whenever other summaries grew, so the cache id changed and the same group was asked again on almost every reply. Conditional summaries had to copy {{#if char}} sections. Each dropped section was rejected and re-queued by reader set, then in halves down to single summaries. Users saw 10–15 minute updates, 25–28k-token outputs and 236 privacy rejections in one chat. The maintainer's spec has three rules: compact only when a character's constant view is over the share; cut the text in half; send only the compaction prompt and the summary.
63bc65f362implements all three. The audit found it meets requirements A–H. The only defect was in the docs: they said a skipped update repeats only when a summary changes. In fact the saved attempt is keyed on the helper connection and model, the temperature and the Combine prompt too. The docs also left out the macro-keeping sentence and that a reply which adds a macro counts as a failed attempt.95f35c80f4fixes those sentences, and issue #8834 now carries the same English text.What changed
95f35c80f4corrections are included.Validation
pnpm checkpasses locallyManual verification notes
Agent-run checks (for reference):
pnpm checkondbfdf55417: exit 0node ./scripts/run-regressions.mjs --filter advanced-memory: 24/24 passedIndependent review of
63bc65f362and95f35c80f4: 2 findings (a run-of-words privacy check that rejected valid per-reader results whenever two sections shared a common phrase, and a reader-set key that depended on name order), both fixed indbfdf55417. Dottore Review: Viable, With Notes, no defects.Known limits and risks:
63bc65f362) and its description say a reply failing 'the existing privacy check' is a failed attempt. That check is no longer applied to compaction: the result is private by construction, and only the size and section-structure checks remain. The PR description should be updated to match.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.