mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #8606] [Issue]: Avoid reparsing unchanged message extras in Advanced Memory #8423
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#8423
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?
Originally created by @gcyrus on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8606
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Advanced Memory reparses every stored message's unchanged
extrametadata each time it builds a context. On large chats this creates excessive allocation and garbage collection, which can stall the Node event loop during generation.Expected behavior
Each unchanged message extra should be parsed once per Advanced Memory service lifetime and reused. Edited or deleted messages must invalidate or remove only their own cached entry.
Actual behavior
Every Advanced Memory context rebuild calls
object(message.extra)for every stored message, even when the message metadata has not changed. A CPU profile of a large chat attributed roughly 209 seconds to this work and roughly 107 seconds to garbage collection during the captured interval.Steps to reproduce
Environment
stagingbaselineLogs, screenshots, or video
The local CPU profile showed repeated
object(message.extra)parsing as the primary Advanced Memory context-construction cost. No user-authored prompt content is included.Additional context
The proposed narrow fix is a chat/message cache keyed by the raw stored
extravalue, with pruning for deleted messages and a regression covering reuse and targeted invalidation.I could not assign this issue to the authenticated GitHub account. @SpicyMarinara, please assign an owner if needed.
Template check