mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1507] [Issue]: Long-Term Memory: a stale settings form can undo Reset or Import, an integrity-only failure shows the wrong message, and Reset loses focus #1498
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#1498
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 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1507
Originally assigned to: @Promansis on GitHub.
Summary
Three follow-ups to #1452 (Reset and Import reload the settings forms), all confirmed in the browser at 1.4.54:
Affected package
Re-checked 2026-10-21 at
upstream/stagingedb9c4928(long-term-memory 1.4.57, built on the Engine's host, capability API 1.341): the fix applies unchanged there; line numbers are at the commit named below.long-term-memory1.4.54 (upstream/stagingb1873710f). PR #1473 (headc4b1c0192) doesn't touch these files.C=packages/long-term-memory/src/engine/packages/client/src/features/long-term-memoryExpected behavior
Actual behavior
1. Remount after a failed reload
refillSince(C/settings/MemorySettings.tsx:214) is component state, so it starts at 0 again when Settings remounts.dataanddataUpdatedAtafter a failed refetch. On remount, the fill effects (:243-248global,:249-254extraction) therefore see data, no form, anddataUpdatedAt >= 0, and fill the forms from the settings cached before the action.globalPayload(:108-111) andextractionPayload(:170-176) send every field of the stale form, and that writes the pre-Reset or pre-Import values back.Browser probe:
2. Import with only the integrity read failed
importBackup(C/settings/MaintenancePanel.tsx:401-407) treats a failed integrity refetch like a failed settings refetch. It callssettings.clear(startedAt)and setsbackupImportedSettingsNotRefreshed.dataUpdatedAtis at or afterstartedAt.integrity.isError(:583-590) and the cachedintegrity.data(:591-600).import-integrity(tests/long-term-memory-browser.regression.ts:3780-3849) asserts both the wrong message and the refreshed value.Browser probe (all status surfaces in the panel after that row's import):
3. Focus after Reset
C/settings/MaintenancePanel.tsx:553) is disabled while the action runs.hidden(:515) while the forms reload (C/settings/MemorySettings.tsx:363-381).body, and nothing restores it.Browser probe (the settings read is delayed 800 ms, then succeeds):
Import goes through the same hidden panel. Its focus was not probed separately.
Steps to reproduce
GET /api/long-term-memory/settings, then click Reset settings. "Could not load memory settings." appears.GET /api/long-term-memory/integrityfails. The message says settings could not be refreshed, the forms show the imported settings, and the old integrity report is still shown.Minimal fix
One PR, patch bump. Client only; no new locale keys.
C/settings/MemorySettings.tsx:244and:250: addglobal.isError ||andextraction.isError ||to the fill gates. While a query is in error, Settings shows the error surface (:383-398). The successful refetch, on mount or through Retry, clearsisErrorwith a newerdataUpdatedAt, and the forms then fill from it. The #1452 Retry path and the import-integrity path are unaffected, because their settings queries are not in error.C/settings/MaintenancePanel.tsx:401-407:backupImportedSettingsNotRefreshed. Otherwise apply the refreshed settings and keep "Memory backup imported." (memoryBackupImported, set at:400).:591, render the cached report only when!integrity.isError, so a failed integrity read shows just its error with Retry.C/settings/MaintenancePanel.tsxfocus:focusAfterReloadref.onClickstoresevent.currentTarget. Import stores the "Choose backup"Button, which forwards refs (C/shared-controls.tsx:21).[hidden, pending]focuses the stored element, then clears the ref. It runs only once the panel is visible and idle, only if the element is still connected, and only if focus is onbody.## Unreleased: one bullet, for example: "Settings no longer refill from values cached before a Reset or Import when the reload failed. A backup import whose integrity check failed reports it correctly. Focus returns to the Reset or Import control after the settings reload."Not included
queryKeys.settingswhile Settings was closed. That gate (queryClient.getQueryState(key)?.isInvalidated) would change every Settings visit. The maintainer chose to fix only the failed-reload case, which theisErrorgate covers.bodyuntil the panel is visible again.Regression proof
Write first, in
tests/long-term-memory-browser.regression.ts, beside the #1452 loop (:3777-3851). The private probe scenario can be turned into assertions:import-integrityrow to expect "Memory backup imported.". The panel shows "Integrity check could not load." and no "Integrity check passed" report.document.activeElementbeing the Reset button (read it as the activity-log focus check at:3291does). Import ends on "Choose backup".Every existing #1452 and #1376 row must still pass.
Environment
stagingcheckout, unchanged; Playwright Chromium from itsnode_modules)upstream/stagingb1873710f,artifacts/long-term-memory-1.4.54.zip)Logs, screenshots, or video
The probe output is quoted under Actual behavior. It came from a throwaway copy of the browser regression with the probe snippet inserted. The whole suite still exits 0, because the probe prints its results rather than asserting them.
Additional context
Tracker item UI-7 (#1452 review follow-ups). The tracker listed three things:
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: