[PR #1551] fix(long-term-memory): stop sending raw error text from the integrity report and model loading on import and re-extract (#1549) #1542

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1551
Author: @Promansis
Created: 10/21/2026
Status: 🔄 Open

Base: staging ← Head: fix(long-term-memory)/integrity-import-raw-errors


📝 Commits (2)

  • dbd8772 fix(long-term-memory): stop sending raw error text from the integrity report and model loading on import and re-extract (#1549)
  • 476cf71 Merge upstream/staging into fix(long-term-memory)/integrity-import-raw-errors; release long-term-memory 1.4.78

📊 Changes

16 files changed (+209 additions, -106 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.78.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 (+33 -33)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/maintenance/maintenance.ts (+8 -2)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/package-runtime.ts (+28 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes/notes.ts (+7 -16)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/sources/interop.ts (+6 -14)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-routes.regression.ts (+83 -1)

📄 Description

Pull request

Linked issue

Closes #1549

Why this change

  • After #1510 and #1547, two paths still send an error's own text to the client, and it can hold absolute file paths:
    • the integrity report: a note file or the event log that cannot be read is reported with the file system's message (EACCES: permission denied, open '/…/vault/…'), which Memory settings shows in its integrity list. The identity-repair apply, repair and backup-restore responses carry the same report.
    • importing or re-extracting a source with extraction: every failure to load the memory model became a 400 ltm_model_configuration with the failure's own message. That suits the Engine's setup messages ("Choose a language model connection before generating content."), but it also covered server failures such as a corrupt key file, whose message names the key file's path. The import route did not log it.

What changed

  • long-term-memory: an unreadable note file or event log is reported as "Note file could not be read or validated." or "Event log could not be read.", followed by "Details are in the server log." A note whose JSON or fields are broken keeps its parse or schema message, as a broken event-log line already does. Issue codes, severities, paths and counts are unchanged; the errors were already logged.
  • long-term-memory: a new resolvePackageLanguageModel helper, used by import and re-extract, keeps the Engine's setup messages as 400 ltm_model_configuration and sends any other resolver failure to routeError, which logs it and returns the route's fallback. Setup messages are matched by their opening words, because the Engine's errors carry no code.
  • long-term-memory: re-extract now reads the extraction settings outside the old catch-all, as import already did. This closes a third path that sent raw text. For a broken extraction settings file:
    • unreadable: before, 400 ltm_model_configuration with EACCES: permission denied, open '<absolute path>/config/extraction.json'; after, 500 ltm_unexpected_failure with the route's fallback, and the error is logged.
    • schema-invalid: before, 400 ltm_model_configuration; after, 400 ltm_invalid_request with the same validation text.
  • Regressions in tests/long-term-memory-routes.regression.ts (scope-identity and imports scenarios). Rebuilt packages/long-term-memory bundles, artifact and catalog entry.

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: none
  • Security note: less error text reaches the client from the integrity report, from model loading on import and re-extract, and from reading the extraction settings on re-extract; the full error goes to the server log. An unexpected model-loading failure or an unreadable settings file now returns the route's 500 fallback instead of a 400 with its own text, and a schema-invalid settings file on re-extract returns 400 ltm_invalid_request instead of 400 ltm_model_configuration. Engine setup messages are 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

  • The routes regression's stub model resolver throws a corrupt key-file message with a private path. On staging, import and re-extract return it as a 400 ltm_model_configuration; with the fix they return the route's fallback, and the import error reaches the server log. The existing missing-model cases now also check that the Engine's setup message is kept.
  • After the persona identity repair, the test makes one vault note and the event log unreadable, writes a note holding { and a valid JSON note that fails the note schema. On staging, GET /integrity carries EACCES: permission denied, open '<absolute path>'; with the fix the two unreadable files get the fixed messages with their vault paths, the parse error still mentions JSON, the schema error still shows the validation text, and the body does not contain the vault's absolute root.

Documentation impact

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

UI evidence (if applicable)

No UI change. The integrity list in Memory settings shows the new message text for an unreadable file.

🤖 Generated with Claude Code


🔄 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/1551 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/21/2026 **Status:** 🔄 Open **Base:** `staging` ← **Head:** `fix(long-term-memory)/integrity-import-raw-errors` --- ### 📝 Commits (2) - [`dbd8772`](https://github.com/Pasta-Devs/Marinara-Agents/commit/dbd877254732a8258f2136ef1ff1676d44307001) fix(long-term-memory): stop sending raw error text from the integrity report and model loading on import and re-extract (#1549) - [`476cf71`](https://github.com/Pasta-Devs/Marinara-Agents/commit/476cf7116057555b86d5e7c6086017b6064d9785) Merge upstream/staging into fix(long-term-memory)/integrity-import-raw-errors; release long-term-memory 1.4.78 ### 📊 Changes **16 files changed** (+209 additions, -106 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.78.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` (+33 -33) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/maintenance/maintenance.ts` (+8 -2) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/package-runtime.ts` (+28 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes/notes.ts` (+7 -16) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/sources/interop.ts` (+6 -14) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-routes.regression.ts` (+83 -1) </details> ### 📄 Description # Pull request ## Linked issue Closes #1549 ## Why this change - After #1510 and #1547, two paths still send an error's own text to the client, and it can hold absolute file paths: - the integrity report: a note file or the event log that cannot be read is reported with the file system's message (`EACCES: permission denied, open '/…/vault/…'`), which Memory settings shows in its integrity list. The identity-repair apply, repair and backup-restore responses carry the same report. - importing or re-extracting a source with extraction: every failure to load the memory model became a 400 `ltm_model_configuration` with the failure's own message. That suits the Engine's setup messages ("Choose a language model connection before generating content."), but it also covered server failures such as a corrupt key file, whose message names the key file's path. The import route did not log it. ## What changed - `long-term-memory`: an unreadable note file or event log is reported as "Note file <vault path> could not be read or validated." or "Event log could not be read.", followed by "Details are in the server log." A note whose JSON or fields are broken keeps its parse or schema message, as a broken event-log line already does. Issue codes, severities, paths and counts are unchanged; the errors were already logged. - `long-term-memory`: a new `resolvePackageLanguageModel` helper, used by import and re-extract, keeps the Engine's setup messages as 400 `ltm_model_configuration` and sends any other resolver failure to `routeError`, which logs it and returns the route's fallback. Setup messages are matched by their opening words, because the Engine's errors carry no code. - `long-term-memory`: re-extract now reads the extraction settings outside the old catch-all, as import already did. This closes a third path that sent raw text. For a broken extraction settings file: - unreadable: before, 400 `ltm_model_configuration` with `EACCES: permission denied, open '<absolute path>/config/extraction.json'`; after, 500 `ltm_unexpected_failure` with the route's fallback, and the error is logged. - schema-invalid: before, 400 `ltm_model_configuration`; after, 400 `ltm_invalid_request` with the same validation text. - Regressions in `tests/long-term-memory-routes.regression.ts` (scope-identity and imports scenarios). Rebuilt `packages/long-term-memory` bundles, artifact and catalog entry. ## 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: none - Security note: less error text reaches the client from the integrity report, from model loading on import and re-extract, and from reading the extraction settings on re-extract; the full error goes to the server log. An unexpected model-loading failure or an unreadable settings file now returns the route's 500 fallback instead of a 400 with its own text, and a schema-invalid settings file on re-extract returns 400 `ltm_invalid_request` instead of 400 `ltm_model_configuration`. Engine setup messages are 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 - The routes regression's stub model resolver throws a corrupt key-file message with a private path. On `staging`, import and re-extract return it as a 400 `ltm_model_configuration`; with the fix they return the route's fallback, and the import error reaches the server log. The existing missing-model cases now also check that the Engine's setup message is kept. - After the persona identity repair, the test makes one vault note and the event log unreadable, writes a note holding `{` and a valid JSON note that fails the note schema. On `staging`, `GET /integrity` carries `EACCES: permission denied, open '<absolute path>'`; with the fix the two unreadable files get the fixed messages with their vault paths, the parse error still mentions JSON, the schema error still shows the validation text, and the body does not contain the vault's absolute root. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) No UI change. The integrity list in Memory settings shows the new message text for an unreadable file. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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#1542
No description provided.