mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[PR #1427] [MERGED] fix(long-term-memory): prune finished drafts and stop writing usage counters (1.4.42) #1455
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#1455
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-Agents/pull/1427
Author: @Promansis
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @Promansis
Base:
staging← Head:fix(long-term-memory)/1404-draft-retention📝 Commits (4)
4f099a8fix(long-term-memory): prune finished drafts and stop writing usage counters (#1404)7b4ff1dchore(long-term-memory): release 1.4.42 (#1404)c0801cefix(long-term-memory): keep finished drafts with an invalid updatedAt (#1404)8561504Merge branch 'staging' into fix(long-term-memory)/1404-draft-retention📊 Changes
16 files changed (+157 additions, -102 deletions)
View changed files
➕
artifacts/long-term-memory-1.4.42.zip(+0 -0)📝
catalog/catalog.json(+6 -6)📝
catalog/notes.json(+6 -6)📝
catalog/v2/catalog.json(+6 -6)📝
catalog/v2/notes.json(+6 -6)📝
catalog/v3/catalog.json(+6 -6)📝
catalog/v3/notes.json(+6 -6)📝
packages/long-term-memory/CHANGELOG.md(+5 -0)📝
packages/long-term-memory/manifest.json(+3 -3)📝
packages/long-term-memory/server.mjs(+36 -36)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/retention.ts(+35 -1)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/usage.ts(+3 -19)📝
scripts/build-feature-packages.mjs(+1 -1)📝
tests/long-term-memory-index-keys.regression.ts(+2 -4)📝
tests/long-term-memory-runtime.regression.ts(+5 -2)📝
tests/long-term-memory-storage.regression.ts(+31 -0)📄 Description
Linked issue
Closes #1404
Why this change
Two Long-Term Memory stores grew with use and were read in full on frequent paths:
usage.jsonwith per-chat, per-memory counters under the vault lock. Nothing reads those counters except the code that expires and deletes them. On the same vault the file was 918 KB, about 92% counters.What changed
retention.ts: step 6 readsdrafts/directly. Going through the draft store would callinitializeLtmStore, which runs retention again. Every draft writer holds the vault lock, which retention also holds. It reuses the existingauditWindowDaysfield, so the retention config schema is unchanged.usage.ts: the per-memory counter update is removed.acceptedReceipts, the duplicate check and the returned receipt are unchanged, so the dispatch result the Engine gets is the same.long-term-memory1.4.42: CHANGELOG entry, version, manifest, rebuiltserver.mjs, artifact and catalog entries.subject-choice-review.tsalready returnsdraft: nullfor a resolved identity decision whose draft is gone, andSubjectIdentityReview.tsxignores that field.acceptedReceiptsstill keeps one id per reply forreceiptRetentionDays. Invalidated drafts are still kept indefinitely.Package and security impact
long-term-memoryusage.chats. Neither deletion can be undone after update. Nothing in the package or the Engine reads either, and Review and Activity show only pending and invalidated drafts.chats: {}is valid for older versions, and a missing draft file is already handled asnull.usage.jsonby hand.Validation
node scripts/validate-catalog.mjspasses locallygit diff --checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the coding agent, not by a person.
2039583ca, Nodev24.15.0.b831ec9f8:retention.draftsRemovedwasundefined, expected3.usage.chatsis{}after the injections and that a repeated accounting id still returnsnull.updatedAtis null or invalid and adds that case to the storage regression, on HEADc0801ce52:test-ci.sh(the local Catalog validation mirror: check, typecheck, security, catalog, locale and release-notes validators) passed.usage.chats[...].injectionCount. It now checks that both accepted receipt ids are recorded.Documentation impact
UI evidence (if applicable)
None. The Review and Activity screens show the same drafts as before.
🤖 Generated with Claude Code
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.