[PR #1459] [MERGED] fix(long-term-memory): keep cached settings out of forms a failed reload cleared (1.4.53) #1472

Closed
opened 2026-10-21 05:11:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix(long-term-memory)/1452-settings-stale-refill


📝 Commits (2)

  • 34afa47 fix(long-term-memory): keep cached settings out of forms a failed reload cleared (#1452)
  • b6fbb23 Merge upstream/staging into fix(long-term-memory)/1452-settings-stale-refill; release long-term-memory 1.4.53

📊 Changes

14 files changed (+155 additions, -72 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.53.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/client.js (+19 -19)
📝 packages/long-term-memory/manifest.json (+3 -3)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MaintenancePanel.tsx (+4 -7)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MemorySettings.tsx (+9 -5)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-browser.regression.ts (+79 -1)

📄 Description

Linked issue

Closes #1452

Why this change

Reset settings and Import backup clear the Memory Settings forms so they reload. Before this fix, the populate effects refilled a cleared form from whatever data the settings query held. If the reload after Reset or Import failed, that data was the cached settings from before the action. Retry on the load error then showed the old settings, and a later Save could write them back over the reset or imported ones. This is tracker item UI-4, a known edge recorded in the #1376 repair notes (PR #1400).

What changed

 MemorySettings                                        # MemorySettings.tsx
+  refillSince = 0
   populate effects (global, extraction)
-    if (!query.data || form) return
+    if (!query.data || form || query.dataUpdatedAt < refillSince) return
   settingsChannel.clear
-    () => { forms = null }
+    (since) => { refillSince = since; forms = null }

 MaintenancePanel                                      # MaintenancePanel.tsx
   resetSettings
-    clear(); startedAt = now; invalidate; refreshed ? apply : clear()
+    startedAt = now; clear(startedAt); invalidate; refreshed ? apply : (forms stay cleared)
   importBackup, settings or integrity not refreshed
-    clear()
+    clear(startedAt)
  • Refills follow dataUpdatedAt. A cleared form now refills only from a query result fetched at or after the action started. dataUpdatedAt is in the effect dependencies, so a Retry that returns the same data still fills the forms.
  • clear takes the action's start time. The issue's example had clear record Date.now() itself. Import calls clear after its awaited invalidation. If only the integrity read failed, the settings refetch would then predate clear, and the forms would stay on "Loading memory settings." with no Retry.
  • Reset no longer needs the second clear() or its comment. apply still loads the refreshed settings on the success path. The backup import's integrity check is unchanged.
  • Visible change. While Reset reloads, the loading message replaces the forms. The Maintenance panel stays mounted but hidden, as the #1376 design comment expected.
  • Release: long-term-memory 1.4.53, with the CHANGELOG entry, version, manifest, rebuilt client.js, artifact and catalog entries. At land, the branch was merged with upstream/staging (1.4.52, #1458). Only the CHANGELOG conflicted, and reland resolved it.

Diff before the release merge: source +13/−12 lines, tests +79/−1, CHANGELOG +4.

Known limits, left outside the Minimal fix:

  • Leaving Settings resets refillSince. It is component state. If someone leaves Settings after a failed reload and comes back, the forms refill from the stale cache. This predates the change.
  • Import with only the integrity read failed. It still says the settings could not be refreshed, although the forms show refreshed settings. The issue keeps that check as it is.
  • Focus during Reset is unverified. Focus on the Reset button is probably lost while the panel is hidden.
  • The gate assumes the clock does not step backwards during the request, as the existing refetchedSince helper already does.

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. The fix is client form state only. Stored settings change only when the user saves.
  • Merge danger: two-way door. It changes when two client forms refill after Reset or Import; there is no server, schema or stored-data change. Reverting restores the old refill. Blast radius: the Memory Settings forms after Reset settings or Import backup.

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

These checks were run by the coding agent, not by a person. Engine checkout 2039583ca, Node v24.15.0.

  • Regression added: tests/long-term-memory-browser.regression.ts.
    • A new loop after the #1376 Reset case has three rows: reset, import and import-integrity.
      • In each, the settings reload fails once. The form does not show the old value, the load error is shown, and Retry loads the new value.
      • Page routes answer Reset, preview, import and integrity, so the server's settings are never changed.
      • Run against the committed pre-fix artifact, it failed at the reset row with '20' !== '37': Retry brought back the old value.
    • The #1376 case now expects the hidden panel:
      • It waits for "Loading memory settings." while the refetch is held.
      • It finds the Reset button with includeHidden: true.
  • On the source commit 34afa474d, these passed:
    • test-ltm.sh browser, feedback-clarity-ui and loading.
    • typecheck-packages, test-fast.sh and the four catalog gates.
  • On release HEAD b6fbb2330 (after merging 1.4.52), these all passed:
    • A package rebuild, which left the tree clean, so the committed outputs match the source.
    • test-fast.sh (npm run check, git diff --check) and typecheck-packages long-term-memory.
    • test-catalog-lanes, validate-package-locales, validate-catalog and catalog-release-notes.
    • test-ltm.sh browser, feedback-clarity-ui and loading.
  • Not done: a manual Reset or Import in Engine with the network failing, and test-ltm.sh all.

Documentation impact

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

UI evidence (if applicable)

None. Two things change on screen:

  • Reset settings: the loading message shows while the settings reload.
  • After a failed reload: Retry on the load error loads the new settings, not the old ones.

🤖 Generated with Claude Code


🔄 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/1459 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/1452-settings-stale-refill` --- ### 📝 Commits (2) - [`34afa47`](https://github.com/Pasta-Devs/Marinara-Agents/commit/34afa474de446507992f5e6da963d945d9fad01b) fix(long-term-memory): keep cached settings out of forms a failed reload cleared (#1452) - [`b6fbb23`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b6fbb23307fa62e98f51a84c6f32106f48972a10) Merge upstream/staging into fix(long-term-memory)/1452-settings-stale-refill; release long-term-memory 1.4.53 ### 📊 Changes **14 files changed** (+155 additions, -72 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.53.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/client.js` (+19 -19) 📝 `packages/long-term-memory/manifest.json` (+3 -3) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MaintenancePanel.tsx` (+4 -7) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MemorySettings.tsx` (+9 -5) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-browser.regression.ts` (+79 -1) </details> ### 📄 Description ## Linked issue Closes #1452 ## Why this change Reset settings and Import backup clear the Memory Settings forms so they reload. Before this fix, the populate effects refilled a cleared form from whatever data the settings query held. If the reload after Reset or Import failed, that data was the cached settings from before the action. Retry on the load error then showed the old settings, and a later Save could write them back over the reset or imported ones. This is tracker item UI-4, a known edge recorded in the #1376 repair notes (PR #1400). ## What changed ```diff MemorySettings # MemorySettings.tsx + refillSince = 0 populate effects (global, extraction) - if (!query.data || form) return + if (!query.data || form || query.dataUpdatedAt < refillSince) return settingsChannel.clear - () => { forms = null } + (since) => { refillSince = since; forms = null } MaintenancePanel # MaintenancePanel.tsx resetSettings - clear(); startedAt = now; invalidate; refreshed ? apply : clear() + startedAt = now; clear(startedAt); invalidate; refreshed ? apply : (forms stay cleared) importBackup, settings or integrity not refreshed - clear() + clear(startedAt) ``` - **Refills follow `dataUpdatedAt`.** A cleared form now refills only from a query result fetched at or after the action started. `dataUpdatedAt` is in the effect dependencies, so a Retry that returns the same data still fills the forms. - **`clear` takes the action's start time.** The issue's example had `clear` record `Date.now()` itself. Import calls `clear` after its awaited invalidation. If only the integrity read failed, the settings refetch would then predate `clear`, and the forms would stay on "Loading memory settings." with no Retry. - **Reset no longer needs the second `clear()` or its comment.** `apply` still loads the refreshed settings on the success path. The backup import's integrity check is unchanged. - **Visible change.** While Reset reloads, the loading message replaces the forms. The Maintenance panel stays mounted but hidden, as the #1376 design comment expected. - **Release:** `long-term-memory` 1.4.53, with the CHANGELOG entry, version, manifest, rebuilt `client.js`, artifact and catalog entries. At land, the branch was merged with `upstream/staging` (1.4.52, #1458). Only the CHANGELOG conflicted, and reland resolved it. Diff before the release merge: source +13/−12 lines, tests +79/−1, CHANGELOG +4. Known limits, left outside the Minimal fix: - **Leaving Settings resets `refillSince`.** It is component state. If someone leaves Settings after a failed reload and comes back, the forms refill from the stale cache. This predates the change. - **Import with only the integrity read failed.** It still says the settings could not be refreshed, although the forms show refreshed settings. The issue keeps that check as it is. - **Focus during Reset is unverified.** Focus on the Reset button is probably lost while the panel is hidden. - **The gate assumes the clock does not step backwards** during the request, as the existing `refetchedSince` helper already does. ## 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. The fix is client form state only. Stored settings change only when the user saves. - **Merge danger:** two-way door. It changes when two client forms refill after Reset or Import; there is no server, schema or stored-data change. Reverting restores the old refill. Blast radius: the Memory Settings forms after Reset settings or Import backup. ## 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 These checks were run by the coding agent, not by a person. Engine checkout `2039583ca`, Node `v24.15.0`. - **Regression added: `tests/long-term-memory-browser.regression.ts`.** - **A new loop after the #1376 Reset case** has three rows: `reset`, `import` and `import-integrity`. - In each, the settings reload fails once. The form does not show the old value, the load error is shown, and Retry loads the new value. - Page routes answer Reset, preview, import and integrity, so the server's settings are never changed. - Run against the committed pre-fix artifact, it failed at the `reset` row with `'20' !== '37'`: Retry brought back the old value. - **The #1376 case now expects the hidden panel:** - It waits for "Loading memory settings." while the refetch is held. - It finds the Reset button with `includeHidden: true`. - **On the source commit `34afa474d`, these passed:** - `test-ltm.sh` `browser`, `feedback-clarity-ui` and `loading`. - `typecheck-packages`, `test-fast.sh` and the four catalog gates. - **On release HEAD `b6fbb2330` (after merging 1.4.52), these all passed:** - A package rebuild, which left the tree clean, so the committed outputs match the source. - `test-fast.sh` (`npm run check`, `git diff --check`) and `typecheck-packages long-term-memory`. - `test-catalog-lanes`, `validate-package-locales`, `validate-catalog` and `catalog-release-notes`. - `test-ltm.sh` `browser`, `feedback-clarity-ui` and `loading`. - Not done: a manual Reset or Import in Engine with the network failing, and `test-ltm.sh all`. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) None. Two things change on screen: - **Reset settings:** the loading message shows while the settings reload. - **After a failed reload:** Retry on the load error loads the new settings, not the old ones. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:11:50 +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#1472
No description provided.