mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1544] [Issue]: Long-Term Memory: Undo, Save, Delete and Rename detail in the Memory Vault stop half-way when another memory is opened meanwhile #1516
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#1516
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/1544
Originally assigned to: @Promansis on GitHub.
Summary
In the Memory Vault, four actions stop half-way when you open another memory before they finish: Undo after an archive, Save, permanent Delete and Rename detail (whose dialog Escape closes while it runs). Depending on the action, the buttons stay disabled, the list keeps showing the old memories, a memory reopened during its own save shows the copy from before the save, deleted memories stay ticked and open, and a partly failed Undo does not put the memories it did restore back into the archive.
Affected package
long-term-memory1.4.72 (upstream/stagingbcaebd07d), which has the fix for bulk changes undone by the open memory (#1535; it addsrefreshAfterBatchand reloads an open memory after an archive Undo), Memory Vault (client).C=packages/long-term-memory/src/engine/packages/client/src/features/long-term-memoryExpected behavior
When one of these actions finishes, the work that belongs to the whole vault is done, whatever memory you opened meanwhile: the busy state clears so the buttons work again, the list reloads, a partly failed Undo archives again the memories it restored, and deleted memories leave the selection. A memory you reopened while its own save ran shows what was saved. A deleted memory you opened closes, with the delete message that says why. Other messages (notices and errors) belong to the memory that was open when the action started, so they are not shown over the new one. The Rename detail dialog stays open while the rename runs, as its disabled Cancel button already intends, so Escape does not close it.
Actual behavior
Each action remembers the editor session when it starts, and when its request answers it returns at once if the session changed. Opening a memory, starting a new one, closing the editor or choosing a place all change the session.
undoArchive,C/vault/MemoryVault.tsx:1441): returns at:1459, and itsfinallyclears the busy flag only for the same session (:1508). After you open a memory during an Undo::1481-1489) is skipped, so the archive is left half-undone in storage.save(),:1543): returns at:1626, and itsfinally(:1699) clears the flag only for the same session. If you open a memory while a slow save runs and choose "Discard and continue", the flag stays "save" and the save state stays "saving": the button reads "Saving", and Save stays disabled for every memory until you leave the Vault. The list is not reloaded, so it keeps the copy from before the save, and reopening the memory you were saving shows that old copy.deleteSelected,:1703): returns at:1708. The flag does clear (the caller'sfinally,:1914), but the selection clear, closing a deleted open memory, the notice and the list reload (:1728) are skipped. The deleted memories stay listed and ticked; a deleted memory you opened meanwhile stays open and fails to save; a later bulk action reports the deleted ids as failed. The open-memory check also reads the memory that was open when the delete started (draftat:1715), not the one open now.renameSection,:1772): its dialog disables Cancel while the rename runs, but Escape still closes the dialog (onCancel,:2524). Another memory can then be opened; the rename returns at:1796and itsfinally(:1829) leaves the flag at "rename-section", with the same disabled controls as the Undo.Reproduced in the browser suite by holding each request's answer, opening a memory (or pressing Escape for Rename detail), then releasing it: the reopened memory keeps its old title (30 s timeout), Undo stays disabled (30 s timeout), no list request follows the delete, and the Rename detail dialog closes on Escape.
Steps to reproduce
Slow the network in the browser's developer tools so each request takes a few seconds.
Undo archive:
Save:
Permanent delete:
Rename detail:
Minimal fix
One PR, patch bump, client only:
C/vault/MemoryVault.tsx. The same pattern as the bulk-change fix: what belongs to the whole vault runs whatever was opened meanwhile; the notice and error stay with the old session.refreshAfterBatch), and check the session after it, before the notice. Clear the Undo only if it is still the one that ran (setArchiveUndo((current) => (current === recovery ? null : current))). Clear the busy flag with the functional form the delete path uses,setBusy((current) => (current === "undo-archive" ? "" : current)).refreshAfterBatch([saved memory id]): the lists, and the open memory if it is the one just saved, so a memory reopened during its own save shows what was saved. Then return as before. Clear the flag with the functional form.draftRef.current) when closing a deleted one. Reload the lists, then show the notice for the same session, or when the deletion closed the open memory.onCancelreturns while busy, like its disabled Cancel button.renameSectionitself is unchanged: with the dialog kept open, the vault behind it cannot open another memory while the rename runs.## Unreleased: "In the Memory Vault, opening another memory while an archive Undo, a save or a permanent delete is still running no longer leaves it half-finished: the buttons work again, the list reloads, an Undo that could only restore some memories archives them again, a memory reopened during its own save shows what was saved, and deleted memories leave the list and the selection, closing one you had opened with a message that says so. Escape no longer closes the Rename detail dialog while the rename is still running."Not included
Regression proof
In
tests/long-term-memory-browser.regression.ts:PATCH, edits its title and presses Save, reopens the same memory with "Discard and continue", then releases the answer. It expects the reopened memory to show the saved title, Save to read "Save" again and to be enabled after an edit, and a new list request.archivedfor the restored memory) to have been sent.current === recoverycheck, the Undo notice's session check, and the delete notice's session check for a deletion that did not close the open memory.Environment
staging87d1ccadc)upstream/stagingbcaebd07d)Logs, screenshots, or video
From the browser suite with each answer held, each action without its fix:
Additional context
Tracker item OT-11. Follow-up to #1535 (bulk change undone by the open memory), whose review found the same early return in these actions.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: