mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6513] [MERGED] fix: preserve memory summaries and make context cutoffs shared and reversible #7208
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#7208
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/6513
Author: @SpicyMarinara
Created: 9/21/2026
Status: ✅ Merged
Merged: 9/22/2026
Merged by: @SpicyMarinara
Base:
staging← Head:codex/sept22-memory-summary-budgets📝 Commits (6)
fe9f0f8docs: track advanced memory summary budget fix1de29c6fix: preserve archived summaries and remove tiny compaction limits5b34570fix: make memory cutoffs shared, reversible, and prompt-budgeted0bfb737fix: reuse message-extra parser for memory flags43b52fbfix: save memory context flags and swipe mirrors atomicallyaceeb07fix: keep personal start flag saves atomic without clearing shared cutoffs📊 Changes
23 files changed (+744 additions, -249 deletions)
View changed files
📝
CHANGELOG.md(+6 -0)📝
docs/agents/memory.md(+7 -7)📝
e2e/advanced-memory.e2e.ts(+29 -12)📝
e2e/issue-sweep-chat.e2e.ts(+3 -0)📝
packages/client/src/components/chat/ChatMessage.tsx(+1 -1)📝
packages/client/src/components/chat/ChatRoleplaySurface.tsx(+3 -6)📝
packages/client/src/hooks/use-chats.ts(+4 -1)📝
packages/client/src/localization/locales/en.json(+2 -2)📝
packages/server/src/routes/chats.routes.ts(+30 -21)📝
packages/server/src/routes/generate.routes.ts(+1 -0)📝
packages/server/src/services/advanced-memory.ts(+160 -110)📝
packages/server/src/services/agents/agent-progress.ts(+14 -2)📝
packages/server/src/services/generation/advanced-memory-context.ts(+10 -2)📝
packages/server/src/services/llm/base-provider.ts(+9 -0)📝
packages/server/src/services/storage/chats.storage.ts(+76 -0)📝
packages/shared/src/types/advanced-memory.ts(+3 -1)📝
scripts/regressions/advanced-memory-context.regression.ts(+6 -0)📝
scripts/regressions/advanced-memory-core.regression.ts(+20 -16)📝
scripts/regressions/advanced-memory-generation.regression.ts(+22 -5)📝
scripts/regressions/advanced-memory-history-start.regression.ts(+148 -36)...and 3 more files
📄 Description
Linked issue
Closes #6512
Why this change
Advanced Memory could fail repeatedly on a 196-token constant-compaction target, duplicate live messages in summaries, and reset context near 30k despite a 65k setting because reply tokens were subtracted from that allowance. Automatic cutoffs also targeted individual characters and could not be removed through the flag menu.
The context setting now limits the estimated outgoing prompt. Automatic scene resets apply to everyone and can be undone through the existing All flag. Saved summaries survive failed helper calls and resume without reprocessing completed work.
What changed
Validation
pnpm checkpasses locallyCONTRIBUTING.mdAutomated local verification:
pnpm checkpassed after the shared and personal flag-save fixes, including localization, formatting, TypeScript, ESLint and production builds. The existing metadata-namespace guard and regeneration/swipe regression also pass.d7c58fa700.Manual verification notes
Manually verify Resume and post-generation consolidation on the affected chat with the selected helper model. Confirm past constants remain included, live-range constants are absent, due scene checks appear after the reply, and unchecking All restores the shared window without clearing personal flags. Fixtures exercise real routes with deterministic provider responses; live GPT-6-Astra output quality and the exact personal archive have not been reprocessed. iPhone coverage uses WebKit emulation rather than a physical device.
Docs and release impact
Updated
CHANGELOG.mdanddocs/agents/memory.md. Translation follow-up #6491 covers all current language packs and the final behavior. No release version change.Review follow-up
No inline findings have appeared on merged #6510; its review status remains pending. Any valid late findings will be addressed separately if posted after this follow-up lands.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.