[GH-ISSUE #1163] [Feature]: Long-Term Memory: identify exact memories in delete confirmation #592

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

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

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Long-Term Memory uses the same generic confirmation for single-row and bulk permanent deletion: "Permanently delete selected memories?" followed by "This cannot be undone." It does not identify the memories being deleted or state their count.

A user reported having three relationship memories with identical titles after bringing memories from different chats into one place. They believed deletion concerned the memory they were viewing, but their important relationship-history memory was deleted instead. Recovery required manually extracting its JSON file from a full backup. The original incident's exact cause remains unconfirmed; investigation did not reproduce title-based deletion or ordinary single-ID deletion fan-out.

The confirmed UI problems are that the dialog gives no way to verify its targets, and bulk selection can include memories hidden by filters. The currently open editor is also separate from the clicked row or checked IDs that actually determine deletion.

Proposed package or change

Improve the permanent-delete confirmation in the existing long-term-memory package's Memory Vault, for both single-row and bulk actions across its supported Conversation, Roleplay, and Game modes.

1. Identify the exact targets

  • Show each target's full title, a short excerpt of its saved content, scope/chat availability, and creation date.
  • Show the unique memory ID as secondary information so identical titles and similar metadata can still be distinguished.
  • Resolve these details from the actual deletion-target IDs, not the currently open editor or unrelated checkbox selection.
  • Keep the confirmed target list and the submitted deletion IDs identical. Cancel or require renewed confirmation if targets cannot be resolved reliably; never silently substitute another memory.

2. Make the count explicit

  • Use singular/plural headings such as "Permanently delete 1 memory?" and "Permanently delete 3 memories?".
  • Label the destructive button "Delete 1 memory permanently" or "Delete 3 memories permanently", rather than a generic affirmative response.
  • Retain a clear warning that permanent deletion cannot be undone through the UI.

3. Include hidden bulk selections

  • List every target, including checked memories hidden by filters; use a scrollable list when necessary rather than omitting targets.
  • Prominently state the hidden-selection count, for example: "2 selected memories are hidden by your filters."
  • Do not change selection semantics as a side effect of opening the dialog. The user must be able to cancel and revise their selection.

4. Make cancellation the safe default

  • Initially focus Cancel, not the destructive button.
  • Escape cancels without sending a deletion request.
  • Pressing Enter immediately after the dialog opens must not confirm permanent deletion.
  • Preserve keyboard access, focus containment, focus restoration, and readable content on desktop and mobile.

Acceptance and regression checks

Leave these unchecked until the implementation is actually verified:

  • With three same-title relationship memories, deleting one row identifies that exact memory using its content and distinguishing metadata; only its ID is submitted and the others remain.
  • A row-level delete never inherits unrelated checked IDs or substitutes the currently open editor's memory.
  • Single and bulk headings/buttons state the exact target count with correct singular/plural wording.
  • Bulk confirmation lists every requested memory, including selections hidden by filters, and reports the hidden count accurately.
  • Cancel, Escape, and immediate Enter send no deletion request; confirming through the explicit destructive action submits exactly the displayed target IDs.
  • The flow remains keyboard accessible and usable at desktop and mobile widths.

This is primarily package-client UI work. Preserve the existing ID-based server deletion contract; do not introduce title-based matching or broaden deletion/cascade behavior.

Why should this be optional?

This is a safety improvement within the existing optional Long-Term Memory Agent package, not a new Engine-core feature or a separate downloadable package. The safer confirmation should apply to every Memory Vault permanent-delete action rather than require an opt-in setting.

Alternatives considered

  • Memory locks: could provide additional protection, but do not address ambiguity about the actual deletion target. Out of scope here.
  • Showing only the title: insufficient because multiple memories can have the same title.
  • Marking the targeted row or comparing it visibly with the open editor: discussed, but not included in the selected scope for this issue.
  • Duplicate-title handling, numbered copies, and merging: potentially useful prevention, but separate work; no automatic rename or merge is proposed here.

Additional context

Investigation examined Agents revision 4e10fb9044f6a3758356526648dbd3fec71df161. The affected MemoryVault.tsx and English UI catalog are unchanged at 35d9dec5984a927c3356379c9be68d0507e2cbaf, the checkout revision when filing this issue.

Relevant source under packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/:

  • MemoryVault.tsx: runBatchForIds builds the generic confirmation; runNoteAction supplies [note.id]; batch supplies the checked-ID set; hiddenChecked tracks selections hidden by filters; deleteSelected posts the target IDs.
  • locales/en.json: permanentlyDeleteSelectedMemories and thisCannotBeUndone supply the generic confirmation text.

The server's routes.ts validates an array of IDs, and storage.ts looks those IDs up directly. Titles do not drive normal Memory Vault deletion.

Investigation evidence on the earlier revision:

  • test-ltm.sh routes-scope-identity passed, including source-lineage preview/staleness guards and preservation of excluded memories.
  • An isolated temporary-vault probe created three same-title relationship notes, deleted one ID, and verified that both siblings and the important history survived. A linked sibling's content also survived.
  • These checks do not establish the cause of the original user's incident and are not browser or installed-artifact proof of the proposed dialog behavior. No implementation is included in this issue.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Sep 30, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1163 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Long-Term Memory uses the same generic confirmation for single-row and bulk permanent deletion: "Permanently delete selected memories?" followed by "This cannot be undone." It does not identify the memories being deleted or state their count. A user reported having three relationship memories with identical titles after bringing memories from different chats into one place. They believed deletion concerned the memory they were viewing, but their important relationship-history memory was deleted instead. Recovery required manually extracting its JSON file from a full backup. The original incident's exact cause remains unconfirmed; investigation did not reproduce title-based deletion or ordinary single-ID deletion fan-out. The confirmed UI problems are that the dialog gives no way to verify its targets, and bulk selection can include memories hidden by filters. The currently open editor is also separate from the clicked row or checked IDs that actually determine deletion. ## Proposed package or change Improve the permanent-delete confirmation in the existing `long-term-memory` package's Memory Vault, for both single-row and bulk actions across its supported Conversation, Roleplay, and Game modes. ### 1. Identify the exact targets - Show each target's full title, a short excerpt of its saved content, scope/chat availability, and creation date. - Show the unique memory ID as secondary information so identical titles and similar metadata can still be distinguished. - Resolve these details from the actual deletion-target IDs, not the currently open editor or unrelated checkbox selection. - Keep the confirmed target list and the submitted deletion IDs identical. Cancel or require renewed confirmation if targets cannot be resolved reliably; never silently substitute another memory. ### 2. Make the count explicit - Use singular/plural headings such as "Permanently delete 1 memory?" and "Permanently delete 3 memories?". - Label the destructive button "Delete 1 memory permanently" or "Delete 3 memories permanently", rather than a generic affirmative response. - Retain a clear warning that permanent deletion cannot be undone through the UI. ### 3. Include hidden bulk selections - List every target, including checked memories hidden by filters; use a scrollable list when necessary rather than omitting targets. - Prominently state the hidden-selection count, for example: "2 selected memories are hidden by your filters." - Do not change selection semantics as a side effect of opening the dialog. The user must be able to cancel and revise their selection. ### 4. Make cancellation the safe default - Initially focus **Cancel**, not the destructive button. - Escape cancels without sending a deletion request. - Pressing Enter immediately after the dialog opens must not confirm permanent deletion. - Preserve keyboard access, focus containment, focus restoration, and readable content on desktop and mobile. ### Acceptance and regression checks Leave these unchecked until the implementation is actually verified: - [ ] With three same-title relationship memories, deleting one row identifies that exact memory using its content and distinguishing metadata; only its ID is submitted and the others remain. - [ ] A row-level delete never inherits unrelated checked IDs or substitutes the currently open editor's memory. - [ ] Single and bulk headings/buttons state the exact target count with correct singular/plural wording. - [ ] Bulk confirmation lists every requested memory, including selections hidden by filters, and reports the hidden count accurately. - [ ] Cancel, Escape, and immediate Enter send no deletion request; confirming through the explicit destructive action submits exactly the displayed target IDs. - [ ] The flow remains keyboard accessible and usable at desktop and mobile widths. This is primarily package-client UI work. Preserve the existing ID-based server deletion contract; do not introduce title-based matching or broaden deletion/cascade behavior. ## Why should this be optional? This is a safety improvement within the existing optional Long-Term Memory Agent package, not a new Engine-core feature or a separate downloadable package. The safer confirmation should apply to every Memory Vault permanent-delete action rather than require an opt-in setting. ## Alternatives considered - **Memory locks:** could provide additional protection, but do not address ambiguity about the actual deletion target. Out of scope here. - **Showing only the title:** insufficient because multiple memories can have the same title. - **Marking the targeted row or comparing it visibly with the open editor:** discussed, but not included in the selected scope for this issue. - **Duplicate-title handling, numbered copies, and merging:** potentially useful prevention, but separate work; no automatic rename or merge is proposed here. ## Additional context Investigation examined Agents revision `4e10fb9044f6a3758356526648dbd3fec71df161`. The affected `MemoryVault.tsx` and English UI catalog are unchanged at `35d9dec5984a927c3356379c9be68d0507e2cbaf`, the checkout revision when filing this issue. Relevant source under `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/`: - `MemoryVault.tsx`: `runBatchForIds` builds the generic confirmation; `runNoteAction` supplies `[note.id]`; `batch` supplies the checked-ID set; `hiddenChecked` tracks selections hidden by filters; `deleteSelected` posts the target IDs. - `locales/en.json`: `permanentlyDeleteSelectedMemories` and `thisCannotBeUndone` supply the generic confirmation text. The server's `routes.ts` validates an array of IDs, and `storage.ts` looks those IDs up directly. Titles do not drive normal Memory Vault deletion. Investigation evidence on the earlier revision: - `test-ltm.sh routes-scope-identity` passed, including source-lineage preview/staleness guards and preservation of excluded memories. - An isolated temporary-vault probe created three same-title relationship notes, deleted one ID, and verified that both siblings and the important history survived. A linked sibling's content also survived. - These checks do not establish the cause of the original user's incident and are not browser or installed-artifact proof of the proposed dialog behavior. No implementation is included in this issue. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:28:52 +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#592
No description provided.