[GH-ISSUE #1375] [Issue]: Long-Term Memory shows glued-together sentences and raw server errors #704

Closed
opened 2026-10-20 17:29:54 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1375

Originally assigned to: @Promansis on GitHub.

Summary

Some Long-Term Memory messages are built from sentence fragments, so users see missing spaces and punctuation, and translators can't reorder them. Separately, the shared request helper always throws an Error, so the localized fallback messages almost never show and users see raw server text such as "Not Found".

Affected package

long-term-memory 1.4.31: ReviewQueue.tsx, ActivityView.tsx, api.ts, source-task.ts, MemoryVault.tsx, MemorySettings.tsx and locales/en.json under packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/.

Expected behavior

  1. The Review batch summary reads as complete sentences with correct spacing and punctuation.
  2. Debug (Activity) metadata lines use a separator a translator can change.
  3. When the server sends no error message, users see a localized message instead of the raw HTTP status text.

Actual behavior

  1. The Review batch summary is assembled at ReviewQueue.tsx:2929-2956 from en.json fragments: :759 ("value1_5cb90a9": "{{value1}}", used at ReviewQueue.tsx:2972), :1202 (batchResultSummary), :1222 ("; {{count}} blocked before Apply") and :1247 ("; {{count}} other {{mutation}} pending"). At 1.4.9 the browser harness showed "Proposals discarded 0 mutations; 1 failedDraft discard failed: …". This code is unchanged.
  2. Activity metadata is joined with a hard-coded " · " at ActivityView.tsx:283, :934, :953, :1184, :1237, :1358, :1366, :1697, :1886, and ", " at :917. "chunk" at :934 is a hard-coded English word.
  3. request() throws payload.error, or else response.statusText (api.ts:141, :159). The 35 error instanceof Error ? error.message : <localized> sites across 9 files therefore never reach their localized fallback. At 1.4.9 the Sources inspector showed a raw "Not Found". English text is also thrown directly at api.ts:173, source-task.ts:268, MemoryVault.tsx:2404 and :2593.

Steps to reproduce

  1. In Review, run a batch in which one draft discard fails, and read the summary line.
  2. Open Debug, select an event, and read its metadata line.
  3. Open a source whose preview request returns 404, and read the error in the Sources inspector.

Environment

  • Marinara Engine version: 2.5.0 line (staging)
  • Package version: long-term-memory 1.4.31 (upstream/staging 39a5c5cfb; LTM files unchanged since cdb583a95)
  • Install type: source (code audit plus the package's browser regression harness)
  • OS + version: not platform-specific
  • Browser or app shell: any

Logs, screenshots, or video

The glued Review summary and the raw "Not Found" were captured by the browser harness at 1.4.9; the code behind both is unchanged at 1.4.31.

Minimal fix

  1. Review summary: replace the fragment keys (:759, :1222, :1247 and the pieces joined at ReviewQueue.tsx:2929-2956) with one whole-sentence key per outcome that takes all counts as placeholders. Delete the {{value1}} passthrough key.
  2. Activity: add one locale key for the metadata separator and one small join helper; use it at the 10 sites listed above. Add a locale key for "chunk".
  3. Errors: in request(), mark errors that carry only the HTTP status (no payload.error), for example with a status field and no server message. Add errorMessage(error, fallback) to api.ts that returns the server message when there is one and the localized fallback otherwise. Replace the 35 inline sites and the private copy at MemorySettings.tsx:94 with it. Move the 4 thrown English strings into locale keys.

Proof: the browser test asserts the batch summary and one Activity metadata line; a small Engine-free test covers errorMessage; a 404 in the browser fixture shows localized text.

Additional context

The locale file also has 34 values that start or end with a separator and 53 keys with an opaque value1 placeholder. This issue covers only the two visible cases above.

Fixing whole sentences is also the groundwork a future Korean UI needs, since Korean can't reorder glued fragments.

After #1374.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 14, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1375 Originally assigned to: @Promansis on GitHub. ## Summary Some Long-Term Memory messages are built from sentence fragments, so users see missing spaces and punctuation, and translators can't reorder them. Separately, the shared request helper always throws an `Error`, so the localized fallback messages almost never show and users see raw server text such as "Not Found". ## Affected package `long-term-memory` 1.4.31: `ReviewQueue.tsx`, `ActivityView.tsx`, `api.ts`, `source-task.ts`, `MemoryVault.tsx`, `MemorySettings.tsx` and `locales/en.json` under `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/`. ## Expected behavior 1. The Review batch summary reads as complete sentences with correct spacing and punctuation. 2. Debug (Activity) metadata lines use a separator a translator can change. 3. When the server sends no error message, users see a localized message instead of the raw HTTP status text. ## Actual behavior 1. The Review batch summary is assembled at `ReviewQueue.tsx:2929-2956` from `en.json` fragments: `:759` (`"value1_5cb90a9": "{{value1}}"`, used at `ReviewQueue.tsx:2972`), `:1202` (`batchResultSummary`), `:1222` (`"; {{count}} blocked before Apply"`) and `:1247` (`"; {{count}} other {{mutation}} pending"`). At 1.4.9 the browser harness showed "Proposals discarded 0 mutations; 1 failedDraft discard failed: …". This code is unchanged. 2. Activity metadata is joined with a hard-coded `" · "` at `ActivityView.tsx:283`, `:934`, `:953`, `:1184`, `:1237`, `:1358`, `:1366`, `:1697`, `:1886`, and `", "` at `:917`. `"chunk"` at `:934` is a hard-coded English word. 3. `request()` throws `payload.error`, or else `response.statusText` (`api.ts:141`, `:159`). The 35 `error instanceof Error ? error.message : <localized>` sites across 9 files therefore never reach their localized fallback. At 1.4.9 the Sources inspector showed a raw "Not Found". English text is also thrown directly at `api.ts:173`, `source-task.ts:268`, `MemoryVault.tsx:2404` and `:2593`. ## Steps to reproduce 1. In Review, run a batch in which one draft discard fails, and read the summary line. 2. Open Debug, select an event, and read its metadata line. 3. Open a source whose preview request returns 404, and read the error in the Sources inspector. ## Environment - Marinara Engine version: 2.5.0 line (`staging`) - Package version: long-term-memory 1.4.31 (`upstream/staging` 39a5c5cfb; LTM files unchanged since cdb583a95) - Install type: source (code audit plus the package's browser regression harness) - OS + version: not platform-specific - Browser or app shell: any ## Logs, screenshots, or video The glued Review summary and the raw "Not Found" were captured by the browser harness at 1.4.9; the code behind both is unchanged at 1.4.31. ## Minimal fix 1. Review summary: replace the fragment keys (`:759`, `:1222`, `:1247` and the pieces joined at `ReviewQueue.tsx:2929-2956`) with one whole-sentence key per outcome that takes all counts as placeholders. Delete the `{{value1}}` passthrough key. 2. Activity: add one locale key for the metadata separator and one small join helper; use it at the 10 sites listed above. Add a locale key for `"chunk"`. 3. Errors: in `request()`, mark errors that carry only the HTTP status (no `payload.error`), for example with a `status` field and no server message. Add `errorMessage(error, fallback)` to `api.ts` that returns the server message when there is one and the localized fallback otherwise. Replace the 35 inline sites and the private copy at `MemorySettings.tsx:94` with it. Move the 4 thrown English strings into locale keys. Proof: the browser test asserts the batch summary and one Activity metadata line; a small Engine-free test covers `errorMessage`; a 404 in the browser fixture shows localized text. ## Additional context The locale file also has 34 values that start or end with a separator and 53 keys with an opaque `value1` placeholder. This issue covers only the two visible cases above. Fixing whole sentences is also the groundwork a future Korean UI needs, since Korean can't reorder glued fragments. After #1374. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:29:54 +07:00
  • closed this issue
  • added the
    bug
    label
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#704
No description provided.