[PR #1547] [MERGED] fix(long-term-memory): stop sending raw error text from identity repair, batch imports and preflight (#1542) #1540

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

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/remaining-raw-error-text


📝 Commits (2)

  • d3cce05 fix(long-term-memory): stop sending raw error text from import, preflight and identity repair (#1542)
  • b93ed91 Merge upstream/staging into fix(long-term-memory)/remaining-raw-error-text; release long-term-memory 1.4.76

📊 Changes

18 files changed (+230 additions, -93 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.76.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 (+22 -22)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/reconciliation.ts (+7 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-processing.ts (+8 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/identity-repair.ts (+2 -4)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/service-error.ts (+3 -7)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/sources/interop.ts (+8 -2)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-extraction-reliability.regression.ts (+18 -2)
📝 tests/long-term-memory-routes.regression.ts (+118 -14)

📄 Description

Pull request

Linked issue

Closes #1542

Why this change

  • After #1510 (the fix for #1506), an unexpected failure in a route is logged and the client gets a fallback message. Three other paths still send the error's own text, which can hold file paths or library internals, and the UI shows it as is: an identity repair whose backup could not be restored, a source that fails to save or extract in a batch import (Sources), and a change that Review's preflight cannot check.
  • isLtmServiceError checks only an error's shape, so it would also take a library error with a numeric statusCode and a string code for one of LTM's own errors and send its message and status. Nothing raises such an error in a route today; this is hardening.

What changed

  • long-term-memory: these paths log the unexpected error on the server and send a message that says "Details are in the server log." LTM's own service errors and cancelled imports keep their messages. Error codes, LTM statuses and retry flags are unchanged.
  • isLtmServiceError now checks instanceof LtmServiceError instead of the error's shape.
  • Regressions in tests/long-term-memory-routes.regression.ts (scope-identity, imports and drafts scenarios) and tests/long-term-memory-extraction-reliability.regression.ts.
  • Release: long-term-memory 1.4.76 on staging 9b5fff9dc, 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: none
  • Security note: less error text reaches the client from Sources, Review and identity repair; the full error goes to the server log. The isLtmServiceError change is defensive hardening with no known trigger: a library error with its own HTTP status would now get the route's 500 fallback, and oversized requests still get the Engine's 413. Settings → Debug → Activity still records a provider's raw error text, as before.

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

  • Three new cases make a dependency throw an error whose message holds a private path: identity repair with a failed restore, a source write failure, and a preflight read failure. On staging the response carries that text; with the fix it carries the generic message and the error reaches the server log. A fourth new case calls routeError directly with a Fastify-shaped error and expects the logged 500 fallback. Two existing cases now expect the generic message: a model failure during import, and a snapshot failure during extraction, which also checks the server log.
  • On the fix commit (base bcaebd07d): typecheck, npm run check, the package build, test-fast.sh, test-ci.sh (one unrelated Calls video test timed out at load ~34 on the first run and passed on the rerun and twice alone), every Long-Term Memory regression suite and the catalog checks pass. On the release head: the package rebuild leaves the tree clean, the catalog, locale and release-notes checks and the typecheck pass, and the routes (including its scope-identity, imports and drafts scenarios) and extraction-reliability suites pass. Hosted CI runs the full suite list on this head.

Documentation impact

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

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Unexpected errors in Sources, Review, extraction, and identity-repair flows now show privacy-safe, task-specific messages instead of potentially exposing internal details.
    • Expected service errors and user-authored messages remain unchanged.
    • Full technical error details continue to be recorded in server logs.
  • Tests

    • Added regression coverage confirming sanitized responses and server-side error logging across affected workflows.
  • Release

    • Updated Long-Term Memory to version 1.4.76.

🔄 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/1547 **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)/remaining-raw-error-text` --- ### 📝 Commits (2) - [`d3cce05`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d3cce050ae4b5760edcfa7f49c83353ac0f6319e) fix(long-term-memory): stop sending raw error text from import, preflight and identity repair (#1542) - [`b93ed91`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b93ed9134ddfcda03d9380a7ba966df1b29eaf5c) Merge upstream/staging into fix(long-term-memory)/remaining-raw-error-text; release long-term-memory 1.4.76 ### 📊 Changes **18 files changed** (+230 additions, -93 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.76.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` (+22 -22) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/reconciliation.ts` (+7 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-processing.ts` (+8 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/identity-repair.ts` (+2 -4) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/service-error.ts` (+3 -7) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/sources/interop.ts` (+8 -2) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-extraction-reliability.regression.ts` (+18 -2) 📝 `tests/long-term-memory-routes.regression.ts` (+118 -14) </details> ### 📄 Description # Pull request ## Linked issue Closes #1542 ## Why this change - After #1510 (the fix for #1506), an unexpected failure in a route is logged and the client gets a fallback message. Three other paths still send the error's own text, which can hold file paths or library internals, and the UI shows it as is: an identity repair whose backup could not be restored, a source that fails to save or extract in a batch import (Sources), and a change that Review's preflight cannot check. - `isLtmServiceError` checks only an error's shape, so it would also take a library error with a numeric `statusCode` and a string `code` for one of LTM's own errors and send its message and status. Nothing raises such an error in a route today; this is hardening. ## What changed - `long-term-memory`: these paths log the unexpected error on the server and send a message that says "Details are in the server log." LTM's own service errors and cancelled imports keep their messages. Error codes, LTM statuses and retry flags are unchanged. - `isLtmServiceError` now checks `instanceof LtmServiceError` instead of the error's shape. - Regressions in `tests/long-term-memory-routes.regression.ts` (scope-identity, imports and drafts scenarios) and `tests/long-term-memory-extraction-reliability.regression.ts`. - **Release:** `long-term-memory` 1.4.76 on staging 9b5fff9dc, 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: none - Security note: less error text reaches the client from Sources, Review and identity repair; the full error goes to the server log. The `isLtmServiceError` change is defensive hardening with no known trigger: a library error with its own HTTP status would now get the route's 500 fallback, and oversized requests still get the Engine's 413. Settings → Debug → Activity still records a provider's raw error text, as before. ## 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 - Three new cases make a dependency throw an error whose message holds a private path: identity repair with a failed restore, a source write failure, and a preflight read failure. On `staging` the response carries that text; with the fix it carries the generic message and the error reaches the server log. A fourth new case calls `routeError` directly with a Fastify-shaped error and expects the logged 500 fallback. Two existing cases now expect the generic message: a model failure during import, and a snapshot failure during extraction, which also checks the server log. - On the fix commit (base bcaebd07d): typecheck, `npm run check`, the package build, `test-fast.sh`, `test-ci.sh` (one unrelated Calls video test timed out at load ~34 on the first run and passed on the rerun and twice alone), every Long-Term Memory regression suite and the catalog checks pass. On the release head: the package rebuild leaves the tree clean, the catalog, locale and release-notes checks and the typecheck pass, and the routes (including its scope-identity, imports and drafts scenarios) and extraction-reliability suites pass. Hosted CI runs the full suite list on this head. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation 🤖 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 * **Bug Fixes** * Unexpected errors in Sources, Review, extraction, and identity-repair flows now show privacy-safe, task-specific messages instead of potentially exposing internal details. * Expected service errors and user-authored messages remain unchanged. * Full technical error details continue to be recorded in server logs. * **Tests** * Added regression coverage confirming sanitized responses and server-side error logging across affected workflows. * **Release** * Updated Long-Term Memory to version 1.4.76. <!-- 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>
bsakaguchi 2026-10-22 04:03:14 +07:00
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#1540
No description provided.