[PR #1510] [MERGED] fix(long-term-memory): log unexpected server errors and show the action's own message (1.4.60) #1521

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

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/server-error-hygiene


📝 Commits (3)

  • eaa2550 fix(long-term-memory): log unexpected server errors and show the action's own message (#1506)
  • 0b54c04 Merge upstream/staging into fix(long-term-memory)/server-error-hygiene; release long-term-memory 1.4.59
  • 5dbf333 Merge upstream/staging into fix(long-term-memory)/server-error-hygiene; release long-term-memory 1.4.60

📊 Changes

27 files changed (+345 additions, -164 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.60.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/long-term-memory/CHANGELOG.md (+4 -0)
📝 packages/long-term-memory/client.js (+1 -1)
📝 packages/long-term-memory/docs/ARCHITECTURE.md (+5 -0)
📝 packages/long-term-memory/manifest.json (+5 -5)
📝 packages/long-term-memory/server.mjs (+55 -55)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/api.ts (+4 -1)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json (+1 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/reconciliation.ts (+77 -16)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/rejected-suggestions.ts (+12 -2)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/note-fork-repair.ts (+10 -4)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/scope-links.ts (+2 -2)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/persistence/backup-restore.ts (+7 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/recall/usage.ts (+2 -2)

...and 7 more files

📄 Description

Pull request

Linked issue

Closes #1506

Why this change

  • An unexpected server failure sent its raw message to the client: a file path or library error could appear on screen, and nothing was logged. When the server did send its generic fallback, the screen showed that English text ("Failed to reset settings") or "Internal Server Error" instead of the action's own localized message.
  • Several messages written for users were thrown as plain errors, so they came back as a 500.
  • Three code comments and one help text described behaviour the package no longer has, and one legacy backup block looked safe to delete when it isn't.

What changed

  • long-term-memory:
    • Routes log every unexpected error and return the route's fallback text with ltm_unexpected_failure. A cancelled import is not logged. Identity-repair apply uses the shared routeError. Deferred index rebuilds return "Index rebuild failed" unless the error is an LTM service error.
    • User-facing errors in draft preflight and accept, fork repair, backup restore and identity resolution are LTM service errors with a 400, 404 or 409 status, so their messages still show. A source import whose low-risk auto-apply hits one of the draft errors is no longer offered for retry, because a retry would repeat it.
    • The client treats ltm_unexpected_failure and the Engine's generic "Internal Server Error" as having no user message, so each action shows its own localized error.
    • usage.json comment and log line (the file holds only the receipt de-duplication list since 1.4.42).
    • A comment marking the backup schema's retrieval block as legacy input that must keep every field.
    • ARCHITECTURE.md explains the existing-note extraction settings, and their help text no longer says those memories are sent to the model.
  • Release: long-term-memory 1.4.60, with the CHANGELOG entry, version, manifest, rebuilt client.js and server.mjs, artifact and catalog entries. At land, the branch was merged with upstream/staging twice (1.4.58, #1509; then 1.4.59, #1511); only the release files conflicted, and the release script resolved them.
  • Not changed: these still pass an underlying message through.
    • The identity-repair restore failure (identity-repair.ts, only when the backup restore also fails).
    • The draft-accept indexRebuild.error; the background rebuild changes where that error is kept, so it follows separately.
    • Per-source import failures (sources/interop.ts, extraction/source-processing.ts, shown in the Sources workspace).
    • Preflight blocker messages.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none
  • New or changed permissions/entrypoints: none. Error responses change:
    • unexpected failures return fixed fallback text instead of internal messages;
    • user-facing errors that were 500s now return 400, 404 or 409;
    • identity-repair apply returns 400 ltm_invalid_request for a Zod error and each service error's own status, like the fork-repair routes.
  • Restart, storage, update, or uninstall impact: no stored data changes. A source import that fails because its auto-apply hits a draft error reports an ltm_draft_* code and is not retryable, instead of finalize_failed and retryable.

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

  • New regressions in tests/long-term-memory-routes.regression.ts, scope-identity scenario:
    • identity-repair apply with an unreadable chat returns the fallback and logs the error;
    • a fork review of character notes returns 400 with its own message;
    • routeError with plain, library and cancelled errors;
    • rebuildAfterMutation.
  • New regressions in tests/long-term-memory-source-pagination.regression.ts: client error text for ltm_unexpected_failure, the Engine's generic 500, a coded service error and a code-less 500.
  • Both fail on staging and pass with the fix.
  • Security-sensitive (route error responses):
    • no raw internal message reaches the client from routeError, identity-repair apply or the deferred-rebuild responses;
    • every such error is logged, except cancellations;
    • service-error messages are unchanged.

Documentation impact

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

UI evidence (if applicable)

  • Error text only; no layout change.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling with clearer operation-specific messages for expected failures.
    • Unexpected server failures now show a safe fallback message while retaining full details in server logs.
    • Validation and conflict errors now return more consistent status information.
    • User-authored validation messages remain unchanged.
  • Documentation

    • Clarified that existing-memory token limits support matching and merging, but those memories are not sent to the model.
    • Updated usage documentation to explain receipt de-duplication data and recovery behavior.

🔄 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/1510 **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)/server-error-hygiene` --- ### 📝 Commits (3) - [`eaa2550`](https://github.com/Pasta-Devs/Marinara-Agents/commit/eaa255012b82132b3af4ae77a081ecd8e3e18138) fix(long-term-memory): log unexpected server errors and show the action's own message (#1506) - [`0b54c04`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0b54c04fe2fa305b5093bf00a995bd1a2b603284) Merge upstream/staging into fix(long-term-memory)/server-error-hygiene; release long-term-memory 1.4.59 - [`5dbf333`](https://github.com/Pasta-Devs/Marinara-Agents/commit/5dbf3337a2471b0d2c6ea9dc609a92a0e52ceff9) Merge upstream/staging into fix(long-term-memory)/server-error-hygiene; release long-term-memory 1.4.60 ### 📊 Changes **27 files changed** (+345 additions, -164 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.60.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/long-term-memory/CHANGELOG.md` (+4 -0) 📝 `packages/long-term-memory/client.js` (+1 -1) 📝 `packages/long-term-memory/docs/ARCHITECTURE.md` (+5 -0) 📝 `packages/long-term-memory/manifest.json` (+5 -5) 📝 `packages/long-term-memory/server.mjs` (+55 -55) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/api.ts` (+4 -1) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json` (+1 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/reconciliation.ts` (+77 -16) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/rejected-suggestions.ts` (+12 -2) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/note-fork-repair.ts` (+10 -4) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/scope-links.ts` (+2 -2) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/persistence/backup-restore.ts` (+7 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/recall/usage.ts` (+2 -2) _...and 7 more files_ </details> ### 📄 Description # Pull request ## Linked issue Closes #1506 ## Why this change - An unexpected server failure sent its raw message to the client: a file path or library error could appear on screen, and nothing was logged. When the server did send its generic fallback, the screen showed that English text ("Failed to reset settings") or "Internal Server Error" instead of the action's own localized message. - Several messages written for users were thrown as plain errors, so they came back as a 500. - Three code comments and one help text described behaviour the package no longer has, and one legacy backup block looked safe to delete when it isn't. ## What changed - `long-term-memory`: - Routes log every unexpected error and return the route's fallback text with `ltm_unexpected_failure`. A cancelled import is not logged. Identity-repair apply uses the shared `routeError`. Deferred index rebuilds return "Index rebuild failed" unless the error is an LTM service error. - User-facing errors in draft preflight and accept, fork repair, backup restore and identity resolution are LTM service errors with a 400, 404 or 409 status, so their messages still show. A source import whose low-risk auto-apply hits one of the draft errors is no longer offered for retry, because a retry would repeat it. - The client treats `ltm_unexpected_failure` and the Engine's generic "Internal Server Error" as having no user message, so each action shows its own localized error. - `usage.json` comment and log line (the file holds only the receipt de-duplication list since 1.4.42). - A comment marking the backup schema's `retrieval` block as legacy input that must keep every field. - `ARCHITECTURE.md` explains the existing-note extraction settings, and their help text no longer says those memories are sent to the model. - **Release:** `long-term-memory` 1.4.60, with the CHANGELOG entry, version, manifest, rebuilt `client.js` and `server.mjs`, artifact and catalog entries. At land, the branch was merged with `upstream/staging` twice (1.4.58, #1509; then 1.4.59, #1511); only the release files conflicted, and the release script resolved them. - Not changed: these still pass an underlying message through. - The identity-repair restore failure (`identity-repair.ts`, only when the backup restore also fails). - The draft-accept `indexRebuild.error`; the background rebuild changes where that error is kept, so it follows separately. - Per-source import failures (`sources/interop.ts`, `extraction/source-processing.ts`, shown in the Sources workspace). - Preflight blocker messages. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none - New or changed permissions/entrypoints: none. Error responses change: - unexpected failures return fixed fallback text instead of internal messages; - user-facing errors that were 500s now return 400, 404 or 409; - identity-repair apply returns 400 `ltm_invalid_request` for a Zod error and each service error's own status, like the fork-repair routes. - Restart, storage, update, or uninstall impact: no stored data changes. A source import that fails because its auto-apply hits a draft error reports an `ltm_draft_*` code and is not retryable, instead of `finalize_failed` and retryable. ## 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 - New regressions in `tests/long-term-memory-routes.regression.ts`, scope-identity scenario: - identity-repair apply with an unreadable chat returns the fallback and logs the error; - a fork review of character notes returns 400 with its own message; - `routeError` with plain, library and cancelled errors; - `rebuildAfterMutation`. - New regressions in `tests/long-term-memory-source-pagination.regression.ts`: client error text for `ltm_unexpected_failure`, the Engine's generic 500, a coded service error and a code-less 500. - Both fail on `staging` and pass with the fix. - Security-sensitive (route error responses): - no raw internal message reaches the client from `routeError`, identity-repair apply or the deferred-rebuild responses; - every such error is logged, except cancellations; - service-error messages are unchanged. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - Error text only; no layout change. 🤖 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** - Improved error handling with clearer operation-specific messages for expected failures. - Unexpected server failures now show a safe fallback message while retaining full details in server logs. - Validation and conflict errors now return more consistent status information. - User-authored validation messages remain unchanged. - **Documentation** - Clarified that existing-memory token limits support matching and merging, but those memories are not sent to the model. - Updated usage documentation to explain receipt de-duplication data and recovery behavior. <!-- 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:04 +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#1521
No description provided.