[PR #1531] [MERGED] fix(long-term-memory): load settings a newer version wrote after a rollback (1.4.69) #1533

Closed
opened 2026-10-22 04:03:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1531
Author: @Promansis
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @Promansis

Base: staging ← Head: fix(long-term-memory)/settings-rollback-nested


📝 Commits (2)

  • fdf5c94 fix(long-term-memory): load settings a newer version wrote after a rollback (#1522)
  • 89f1d88 Merge upstream/staging into fix(long-term-memory)/settings-rollback-nested; release long-term-memory 1.4.69

📊 Changes

17 files changed (+569 additions, -140 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.69.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 (+4 -0)
📝 packages/long-term-memory/manifest.json (+3 -3)
📝 packages/long-term-memory/server.mjs (+41 -41)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/extraction-config.ts (+23 -16)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/persistence/backup-restore.ts (+27 -8)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/persistence/retention.ts (+8 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/persistence/storage.ts (+3 -3)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/settings.ts (+125 -27)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-storage.regression.ts (+298 -4)

📄 Description

Pull request

Linked issue

Closes #1522

Why this change

  • After a rollback, a settings file written by a newer Long-Term Memory still stops the package from starting when the newer version added a key inside a nested object, a new enum value or a raised limit. Since 1.4.39 (#1415) only unknown top-level keys are tolerated. One such value fails activation, Settings, extraction, export and saving.

What changed

  • long-term-memory: the shared settings loader (settings.ts) now removes, at any depth, keys this version does not know, enum values it does not have and values outside its range, so each falls back to its default; a list keeps its known entries. It logs the paths once, never the values.
  • The three settings writers (global, extraction, first-activation rewrite) save through a new withNewerLtmSettings, so the newer values stay in the file until the user changes that setting. A field the Settings form sends back unchanged does not replace them. When the user deletes a template, a newer mode's choice of it is dropped, so the newer version can still load the file.
  • Retention cleanup pauses while its settings hold a value this version could not use, so nothing is deleted by a fallback limit. Delete all keeps the stored settings files, so the pause and the newer values survive it.
  • Wrong types, wrong shapes, a different version, cross-field rules, request bodies and newer backups stay strict.
  • Regression: a new block in tests/long-term-memory-storage.regression.ts.
  • Release: long-term-memory 1.4.69 on staging 04c8dafed, with the CHANGELOG entry, version, manifest, rebuilt server.mjs, artifact and catalog entries.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: settings files written by a newer version now load after a rollback, and their newer values stay on disk, including through Delete all. Retention pauses while its own settings hold such a value. Restoring a backup made during the rollback writes the fallback values it holds, which ends the pause. Settings trust boundary: only unknown keys, unknown enum values and out-of-range values in stored files are tolerated; request bodies and backup restore stay strict.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • tests/long-term-memory-storage.regression.ts fails on staging at activation (too_big at receiptRetentionDays) and passes with the fix. Removing the retention pause, the equal-value rule, the template filter, the stop-word comparison or the stored files in Delete all each makes it fail.
  • long-term-memory-runtime, -routes and -routes-backup regressions pass. Typecheck, lint, the package build and every Long-Term Memory regression suite pass on the release head.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

UI evidence (if applicable)

  • n/a (server)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Long-Term Memory updated to version 1.4.69.
    • Improved rollback support for settings created by newer versions, including fallback defaults and preservation of recognized list entries.
    • Newer settings remain available through saves, restores, and deletion operations when possible.
  • Bug Fixes

    • Automatic cleanup now pauses when incompatible newer retention settings are detected.
    • Existing validation continues to reject invalid types, oversized templates, excessive templates, and newer backups.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1531 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/settings-rollback-nested` --- ### 📝 Commits (2) - [`fdf5c94`](https://github.com/Pasta-Devs/Marinara-Agents/commit/fdf5c94a9fb8e81e08a1f108d409f93838c272ff) fix(long-term-memory): load settings a newer version wrote after a rollback (#1522) - [`89f1d88`](https://github.com/Pasta-Devs/Marinara-Agents/commit/89f1d884779be8ccb6fc38e8da9894c4e7f27184) Merge upstream/staging into fix(long-term-memory)/settings-rollback-nested; release long-term-memory 1.4.69 ### 📊 Changes **17 files changed** (+569 additions, -140 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.69.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` (+4 -0) 📝 `packages/long-term-memory/manifest.json` (+3 -3) 📝 `packages/long-term-memory/server.mjs` (+41 -41) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/extraction-config.ts` (+23 -16) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/persistence/backup-restore.ts` (+27 -8) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/persistence/retention.ts` (+8 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/persistence/storage.ts` (+3 -3) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/settings.ts` (+125 -27) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-storage.regression.ts` (+298 -4) </details> ### 📄 Description # Pull request ## Linked issue Closes #1522 ## Why this change - After a rollback, a settings file written by a newer Long-Term Memory still stops the package from starting when the newer version added a key inside a nested object, a new enum value or a raised limit. Since 1.4.39 (#1415) only unknown top-level keys are tolerated. One such value fails activation, Settings, extraction, export and saving. ## What changed - `long-term-memory`: the shared settings loader (`settings.ts`) now removes, at any depth, keys this version does not know, enum values it does not have and values outside its range, so each falls back to its default; a list keeps its known entries. It logs the paths once, never the values. - The three settings writers (global, extraction, first-activation rewrite) save through a new `withNewerLtmSettings`, so the newer values stay in the file until the user changes that setting. A field the Settings form sends back unchanged does not replace them. When the user deletes a template, a newer mode's choice of it is dropped, so the newer version can still load the file. - Retention cleanup pauses while its settings hold a value this version could not use, so nothing is deleted by a fallback limit. Delete all keeps the stored settings files, so the pause and the newer values survive it. - Wrong types, wrong shapes, a different `version`, cross-field rules, request bodies and newer backups stay strict. - Regression: a new block in `tests/long-term-memory-storage.regression.ts`. - **Release:** `long-term-memory` 1.4.69 on staging 04c8dafed, with the CHANGELOG entry, version, manifest, rebuilt `server.mjs`, artifact and catalog entries. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: settings files written by a newer version now load after a rollback, and their newer values stay on disk, including through Delete all. Retention pauses while its own settings hold such a value. Restoring a backup made during the rollback writes the fallback values it holds, which ends the pause. Settings trust boundary: only unknown keys, unknown enum values and out-of-range values in stored files are tolerated; request bodies and backup restore stay strict. ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - `tests/long-term-memory-storage.regression.ts` fails on `staging` at activation (`too_big at receiptRetentionDays`) and passes with the fix. Removing the retention pause, the equal-value rule, the template filter, the stop-word comparison or the stored files in Delete all each makes it fail. - `long-term-memory-runtime`, `-routes` and `-routes-backup` regressions pass. Typecheck, lint, the package build and every Long-Term Memory regression suite pass on the release head. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - n/a (server) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Long-Term Memory updated to version 1.4.69. * Improved rollback support for settings created by newer versions, including fallback defaults and preservation of recognized list entries. * Newer settings remain available through saves, restores, and deletion operations when possible. * **Bug Fixes** * Automatic cleanup now pauses when incompatible newer retention settings are detected. * Existing validation continues to reject invalid types, oversized templates, excessive templates, and newer backups. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1533
No description provided.