[PR #546] [MERGED] Fix Memory Recall refresh after message edits #4668

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/546
Author: @cha1latte
Created: 5/8/2026
Status: ✅ Merged
Merged: 5/8/2026
Merged by: @cha1latte

Base: main ← Head: fix/issue-445-memory-recall-refresh


📝 Commits (1)

  • 2fe465e Fix Memory Recall refresh after message edits

📊 Changes

6 files changed (+192 additions, -4 deletions)

View changed files

📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+9 -4)
📝 packages/client/src/hooks/use-chats.ts (+10 -0)
📝 packages/server/src/routes/chats.routes.ts (+34 -0)
📝 packages/server/src/services/memory-recall.ts (+20 -0)
📝 packages/server/src/services/storage/chats.storage.ts (+30 -0)
➕ packages/server/test/memory-recall.test.ts (+89 -0)

📄 Description

Linked issue

Closes #445

Why this change

  • Memory Recall could keep showing stale fragments after a GM message was edited because refresh only refetched existing chunks instead of rebuilding them from the edited chat log.

What changed

  • Invalidate memory chunks from the edited/deleted message onward when chat messages change.
  • Add a server refresh endpoint that clears and rebuilds Memory Recall chunks from current chat messages.
  • Wire the Memory Recall refresh button to the rebuild endpoint.
  • Add a route-level regression test for issue #445.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Codex validation performed:

  • pnpm --filter @marinara-engine/server exec tsx scratch\bug-445-repro.ts passed. Before the fix, the repro showed the edited message changed to silverleaf while the memory chunk still contained stale florblesnatch; after the fix, edit invalidation removed the stale chunk and refresh rebuilt one chunk with silverleaf and without florblesnatch.
  • pnpm --filter @marinara-engine/server exec tsx --test test\memory-recall.test.ts passed.
  • pnpm check passed.

Manual verification notes

  • Machine verification covered the storage invalidation and refresh/rebuild path with a scratch repro and a committed route-level regression test.
  • I did not run a full browser click-through for the drawer button; the client change is limited to calling the new refresh mutation and invalidating the existing Memory Recall query.
  • Container verification was not run.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No docs or release/version files changed.

UI evidence (if applicable)

N/A - this fix is verified by server/storage repro output and a route-level regression test rather than a visible UI state.


🔄 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-Engine/pull/546 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/8/2026 **Status:** ✅ Merged **Merged:** 5/8/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `main` ← **Head:** `fix/issue-445-memory-recall-refresh` --- ### 📝 Commits (1) - [`2fe465e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2fe465e057588cc3bf9233b67ebe965a41c1e594) Fix Memory Recall refresh after message edits ### 📊 Changes **6 files changed** (+192 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+9 -4) 📝 `packages/client/src/hooks/use-chats.ts` (+10 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+34 -0) 📝 `packages/server/src/services/memory-recall.ts` (+20 -0) 📝 `packages/server/src/services/storage/chats.storage.ts` (+30 -0) ➕ `packages/server/test/memory-recall.test.ts` (+89 -0) </details> ### 📄 Description ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #445 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Memory Recall could keep showing stale fragments after a GM message was edited because refresh only refetched existing chunks instead of rebuilding them from the edited chat log. ## What changed <!-- List the key changes in this PR --> - Invalidate memory chunks from the edited/deleted message onward when chat messages change. - Add a server refresh endpoint that clears and rebuilds Memory Recall chunks from current chat messages. - Wire the Memory Recall refresh button to the rebuild endpoint. - Add a route-level regression test for issue #445. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Codex validation performed: - `pnpm --filter @marinara-engine/server exec tsx scratch\bug-445-repro.ts` passed. Before the fix, the repro showed the edited message changed to `silverleaf` while the memory chunk still contained stale `florblesnatch`; after the fix, edit invalidation removed the stale chunk and refresh rebuilt one chunk with `silverleaf` and without `florblesnatch`. - `pnpm --filter @marinara-engine/server exec tsx --test test\memory-recall.test.ts` passed. - `pnpm check` passed. ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Machine verification covered the storage invalidation and refresh/rebuild path with a scratch repro and a committed route-level regression test. - I did not run a full browser click-through for the drawer button; the client change is limited to calling the new refresh mutation and invalidating the existing Memory Recall query. - Container verification was not run. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No docs or release/version files changed. ## UI evidence (if applicable) N/A - this fix is verified by server/storage repro output and a route-level regression test rather than a visible UI state. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:09:38 +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-Engine#4668
No description provided.