mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1549] [Issue]: Long-Term Memory: the integrity report and model loading for import and re-extract still send raw server errors to the client #1517
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#1517
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1549
Originally assigned to: @Promansis on GitHub.
Summary
After the error-message hygiene fix and the follow-up for the remaining raw error text, two paths still send an error's own text to the client. The text can hold absolute file paths:
EACCES: permission denied, open '/data/marinara/long-term-memory/vault/characters/char_mara.json'. Memory settings lists these messages. The identity-repair apply, repair and backup-restore responses carry the same report.ltm_model_configurationerror with the failure's own message, and the import route sends it as is without logging it. That suits the Engine's setup messages, such as "Choose a language model connection before generating content.", but it also covers server failures. The Engine's corrupt key-file message, for example, names the key file's absolute path. Re-extracting one source wraps the resolver the same way: it logs the error, but still sends its text.Affected package
long-term-memory1.4.76 (upstream/staging79d45f80e).S=packages/long-term-memory/src/engine/packages/server/src/services/long-term-memoryC=packages/long-term-memory/src/engine/packages/client/src/features/long-term-memoryExpected behavior
path, and the message says the details are in the server log. The event log gets the same treatment. A note whose JSON or fields are broken keeps its parse or schema message, because that describes the note, not the server; a broken event-log line already shows its message the same way (malformed_event). Issue codes, severities, paths, note ids and counts stay as they are.ltm_model_configurationerror. Any other resolver failure is logged, and the client gets the route's fallback message, like any other unexpected failure after the hygiene fix.Actual behavior
Line numbers are on
upstream/staging79d45f80e(refreshed 2026-10-21; first checked on8b72729f1).checkEventLogand the note loop useerror.messageas the issue message (S/maintenance/maintenance.ts:99for the event log,:249for a note). Both errors are already logged (:94,:244).GET /integrity(S/routes/maintenance.ts:240) returns the report, and Memory settings shows the first 20 issues as "severity: message" (C/settings/MaintenancePanel.tsx:625-627). The panel does not showpath, so the raw message was the only place it named the file. The same report is part of the identity-repair apply response (S/identity/identity-repair.ts:134,:146), the repair response (S/maintenance/maintenance.ts:424) and the backup-restore response (S/persistence/backup-restore.ts:168,:178). The client does not readintegrityfrom those three responses; it refetches/integrity.importPackageInteropwraps everyresolveForRequestfailure as a service error with the failure's message (S/sources/interop.ts:921-933). The import route hands it torouteError(S/routes/imports.ts:76), which sends a service error's message and does not log it.S/routes/notes.ts:577-590has the same wrap. The route logs every error first (:630), but the client still gets the text. The wrap also coversgetLtmExtractionConfig, so a settings-file read failure is reported as a model configuration error with its own text.The Engine's setup messages are plain
Errors with fixed wording (packages/server/src/services/capability-packages/capability-language-model.service.ts:34,:90,:103,:136,:138,:147,:157,:159andpackages/server/src/services/llm/provider-registry.ts:68in Marinara Engine). Other failures come from the same call, for example the key-file checks inpackages/server/src/utils/crypto.ts:62, which puts the key file's path in its message, and database reads.Steps to reproduce
new Error("Encryption key file at /private/marinara/.encryption-key is corrupt.").POST /api/long-term-memory/import/source-noteswith extraction on.{ error: "Encryption key file at /private/marinara/.encryption-key is corrupt.", code: "ltm_model_configuration" }, and nothing reaches the server log.For the integrity report: make one vault note file and
events/log.jsonlunreadable (chmod 000), then callGET /api/long-term-memory/integrity. Themalformed_noteandevent_log_unreadableissues carryEACCES: permission denied, open '<absolute path>'.In normal use: vault files owned by another user, for example after running the Engine once with
sudo, show their absolute paths in the integrity list in Memory settings.Minimal fix
One PR, patch bump. Server only.
S/maintenance/maintenance.ts: the event log issue says "Event log could not be read. Details are in the server log." A note issue keeps the message of aSyntaxErrororZodError(the note's own content) and otherwise says "Note file could not be read or validated. Details are in the server log." The existing log calls stay.S/package-runtime.ts: aresolvePackageLanguageModelhelper, used by import and re-extract, turns only the Engine's setup messages into the 400ltm_model_configurationservice error and rethrows anything else, sorouteErrorlogs it and sends the route's fallback. The setup messages are matched by their opening words, the same way the package already reads provider messages; a reworded Engine message falls back to the generic path.S/sources/interop.ts,S/routes/notes.ts: call the helper instead of their own wrap. Re-extract reads the extraction settings outside it, as import already does. An unreadable settings file then gets the route's fallback and the server log instead of a 400 withEACCES: permission denied, open '<absolute path>', and a settings file that fails validation gets 400ltm_invalid_requestwith the same text instead ofltm_model_configuration.## Unreleased: "Two more places no longer show raw error text, which could include file paths. In the integrity list in memory settings, a note file or event log that cannot be read now says "Note file vault/… could not be read or validated." or "Event log could not be read.", followed by "Details are in the server log."; a note whose contents are broken still says what is wrong with it. When importing or re-extracting a source fails because the memory model or its settings could not be loaded for a server reason, Sources and Review show their usual "could not be imported" or "could not be re-extracted" message and the error goes to the server log. Messages that tell you how to fix the model setup, such as "Choose a language model connection before generating content.", show as before."Not included
integritystays in the identity-repair apply, repair and backup-restore responses. With the fix it carries no raw text, and dropping it would change three response schemas for no user gain.pathin Memory settings. A parse error's message still does not say which file it is about; that is a client change.ENCRYPTION_KEYvalue. They now get the fallback and the server log, like any other server failure.Regression proof
tests/long-term-memory-routes.regression.ts:{, and one valid JSON note that fails the note schema.GET /integrityreturns the two 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.ltm_unexpected_failurewith "Failed to extract long-term memory from source note". The existing missing-model case now also checks that the Engine's setup message is kept.ltm_unexpected_failurewith "Failed to import long-term memory sources", and the error in the logger stub. The existing missing-model import now also checks the kept setup message.Environment
staging87d1ccadc)upstream/staging79d45f80e)Logs, screenshots, or video
None. The regression cases above show the leaked text with made-up paths.
Additional context
Tracker item OT-12. Found by the review of #1542 (remaining raw error text). Follows the clean-up in #1506.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@Promansis commented on GitHub (Oct 21, 2026):
Fixed in staging by #1551 (long-term-memory 1.4.78).