Skip to content

fix(long-term-memory): 1.4.8 — ignore invalid saved recall settings instead of breaking reads (#1246) - #1249

Merged
Promansis merged 2 commits into
Pasta-Devs:stagingfrom
Promansis:fix(long-term-memory)/invalid-settings-fallback
Oct 7, 2026
Merged

Promansis merged 2 commits into
Pasta-Devs:stagingfrom
Promansis:fix(long-term-memory)/invalid-settings-fallback

Conversation

@Promansis

@Promansis Promansis commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1246

Why this change

  • A persisted null Long-Term Memory recall weight, or an unrecognized stored recall style, made every global settings read throw (ZodError: Expected number, received null). Because settings load on the recall path, one bad settings.json value broke settings, recall and search until the file was hand-edited.
  • The invalid value could be written back by a save, so the corruption persisted across restarts.

What changed

  • packages/long-term-memory 1.4.8: ltmGlobalSettingsSchema now drops null/undefined recall weights and deletes an unrecognized longTermMemoryRecallStyle before merging resolved defaults. A present-but-undefined style key no longer overwrites the default, and a null weight is no longer persisted.
  • Added a storage regression covering null weight, unknown style, null-save recovery, non-persistence, a valid weight, and backup restore fallback.
  • Rebuilt server.mjs, client.js, manifest.json, catalog lanes (catalog/, catalog/v2/, catalog/v3/) and artifacts/long-term-memory-1.4.8.zip; added the 1.4.8 CHANGELOG entry.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none — engine.min 2.4.1 and engine.maxExclusive unchanged
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: settings init already rewrites invalid settings.json; invalid saved values now recover to defaults instead of throwing. Install/update/uninstall lifecycle unchanged.

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

  • Local runs on this HEAD (not claimed as human checkboxes): test-ltm.sh storage|runtime|routes|routes-backup|conversation-summary-import|installation, npm run check, git diff --check, test-catalog-lanes.mjs, validate-package-locales.mjs, validate-catalog.mjs, catalog-release-notes.regression.mjs.
  • Hosted CI for the pushed SHA is pending; CodeRabbit review not yet run.

Documentation impact

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

UI evidence (if applicable)

Summary by CodeRabbit

  • Bug Fixes
    • Invalid saved Long-Term Memory recall settings now fall back to their defaults instead of preventing settings from loading. Invalid values aren’t saved back.
  • Updates
    • Long-Term Memory is now version 1.4.8.

…nstead of breaking reads (Pasta-Devs#1246)

A persisted null recall weight or unknown recall style made every settings read and recall throw until settings.json was hand-edited. The settings schema now drops null/undefined weights and an unrecognized style so the resolved default applies, and the invalid value is no longer written back.

Refs Pasta-Devs#1246
@Promansis Promansis self-assigned this Oct 6, 2026
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Pasta-Devs/Marinara-Agents/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bb85ce35-10c3-4b5f-bfe6-64eed4fb1eb5
📥 Commits

Reviewing files that changed from the base of the PR and between 474b380 and d974576.

⛔ Files ignored due to path filters (3)
  • artifacts/long-term-memory-1.4.8.zip is excluded by !**/*.zip, !artifacts/**
  • packages/long-term-memory/client.js is excluded by !packages/**/client.js
  • packages/long-term-memory/server.mjs is excluded by !packages/**/server.mjs
📒 Files selected for processing (11)
  • catalog/catalog.json
  • catalog/notes.json
  • catalog/v2/catalog.json
  • catalog/v2/notes.json
  • catalog/v3/catalog.json
  • catalog/v3/notes.json
  • packages/long-term-memory/CHANGELOG.md
  • packages/long-term-memory/manifest.json
  • packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema.ts
  • scripts/build-feature-packages.mjs
  • tests/long-term-memory-storage.regression.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Long-Term Memory now removes invalid saved recall weights and unrecognized recall styles before strict settings validation, allowing defaults to apply. Regression tests cover loading, saving, and backup restore. Package and catalog metadata now reference version 1.4.8.

Changes

Long-Term Memory settings fallback

Layer / File(s) Summary
Normalize invalid settings and verify defaults
packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema.ts, tests/long-term-memory-storage.regression.ts
The schema removes null or undefined recall weights and unrecognized recall styles before validation. Tests check default values when loading or restoring a backup, and check that invalid weights are not persisted when settings are saved.
Update 1.4.8 release metadata
scripts/build-feature-packages.mjs, packages/long-term-memory/manifest.json, packages/long-term-memory/CHANGELOG.md, catalog/*/catalog.json, catalog/*/notes.json
The package version and artifact metadata are updated to 1.4.8. Release notes describe the fallback behavior. The catalogs remove the older 1.3.28 entry.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to d9745

Invalid saved recall settings now fall back to defaults, and the checked-in release metadata matches the package artifact. No material merge risk remains based on the reviewed evidence; normal checks should still complete.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (8 skipped: 8 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Long-Term Memory fix for invalid saved recall settings. It is specific and directly related to the main change.
Description check ✅ Passed The description covers the linked issue, problem, changes, package impact, validation, and documentation impact. It lists local test runs and notes that hosted CI is pending; unchecked validation boxe…
Linked Issues check ✅ Passed Issue #1246 requires invalid saved recall weights and styles to resolve to defaults, so settings reads and recovery paths continue to work. The schema preprocessing removes null or undefined weights a…
Out of Scope Changes check ✅ Passed The schema change and regression test directly address issue #1246. The package version, changelog, manifest, catalog entries, and release artifact metadata support publishing the fix. The summary sho…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (8 skipped: 8 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema.ts

typescript-eslint does not support TS 7.0.
Please see https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0 to run typescript-eslint using the TS 6 API.
See also typescript-eslint/typescript-eslint#10940 for tracking typescript-eslint's support for TS >=7.1

Oops! Something went wrong! :(

ESLint: 10.11.0

Error: typescript-eslint does not support TS 7.0.
at Object. (/.eslint-tmp/node_modules/typescript-eslint/dist/index.js:52:11)
at Module._compile (node:internal/modules/cjs/loader:1830:14)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:326:3)
at ModuleWrap. (node:internal/modules/esm/translators:231:7)
at ModuleJob.run (node:internal/modules/esm/module_job:437:25)
at async node:internal/modules/esm/loader:639:26

scripts/build-feature-packages.mjs

ESLint skipped: the matched ESLint configuration already failed (config-incompatibility).

tests/long-term-memory-storage.regression.ts

ESLint skipped: the matched ESLint configuration already failed (config-incompatibility).


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added bugfix Bug fix docs packages Agent package sources and manifests artifacts Generated downloadable package artifacts catalog Official catalog and package schemas build Build scripts, snapshots, and validation labels Oct 6, 2026
@Promansis
Promansis marked this pull request as ready for review October 6, 2026 23:57
@Promansis
Promansis merged commit 4eee7a2 into Pasta-Devs:staging Oct 7, 2026
19 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

artifacts Generated downloadable package artifacts bugfix Bug fix build Build scripts, snapshots, and validation catalog Official catalog and package schemas docs packages Agent package sources and manifests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant