mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1535] [Issue]: Long-Term Memory: opening a memory while a bulk availability change runs shows, and can save back, its old availability #1511
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#1511
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/1535
Originally assigned to: @Promansis on GitHub.
Summary
In the Memory Vault, a bulk change (Change availability, Set status, Set modes, Archive) is undone, or left half-finished, when you open a memory before it finishes. The bulk availability panel closes as soon as you press Apply and the change runs in the background. If you open a memory meanwhile, the vault stops following the change when it answers: the memory list is not reloaded, the bulk buttons stay disabled, and the memory you opened keeps showing its availability from before the change. Saving the memory, or its availability from an "Edit availability" panel opened after the change finished, writes the old places back.
A memory that is already open and is part of the change has the same problem without any click: the list reloads, but the open memory keeps its old availability.
Affected package
long-term-memory1.4.69 (upstream/staging5984f0784), Memory Vault (client).C=packages/long-term-memory/src/engine/packages/client/src/features/long-term-memoryExpected behavior
When a bulk change finishes, the memory list reloads and the bulk buttons work again, whatever was opened in the meantime. An open memory that was part of the change shows the new availability; without unsaved edits it shows the whole reloaded memory, including a new status after a bulk Set status or Archive and the restored status after an archive Undo. If it has unsaved edits, those edits are kept and only its availability is updated, so saving it afterwards does not put back what the bulk change removed. (An "Edit availability" panel that is already open at that moment keeps its own copy; see "Not included".)
Actual behavior
runBatchForIds(C/vault/MemoryVault.tsx:1802) remembers the editor session, sendsPOST /notes/batch, and after the answer returns at once if the session changed (:1921). Opening a memory (openNote,:1335), starting a new one or switching place all change the session.invalidate()(:1975) never runs: the list, counts and place lists keep the notes from before the change.finallyclears the busy flag only for the same session (:1980). Every control withdisabled={Boolean(busy)}stays disabled: the bulk buttons, each row's Archive and Delete, the editor's Remove detail and Rename detail, and Undo. It clears only when another action resets the flag, for example saving a memory.openNotecopies the list's note). The editor and its "Edit availability" panel show the old scope.saveAvailability(:1486) sends the panel's whole scope and modes, and Save sends scope and modes with the rest of the memory, so either one writes the old places back.Reproduced every time in the browser suite by delaying the
/notes/batchanswer by 1.5 s: the memory opened during the change shows 5 places ("Bulk chat 7", "Unavailable chat", "Conversation A", "Character A", "Persona A") instead of 4, the row actions stay disabled, and no list request follows the change.Steps to reproduce
For the already-open case: open the memory first, then do step 2 with it ticked. After Apply the editor still counts the removed chat.
Minimal fix
One PR, patch bump, client only:
C/vault/MemoryVault.tsx.refreshAfterBatchstep after every bulk answer: reload the queries asinvalidate()does, then, if the open memory is in the answer'saffectedNoteIds, load it again (GET /notes/:id). An editor without unsaved edits takes the reloaded memory. An editor with unsaved edits takes only the availability (scope and modes) and the version, as an availability save already does. The reloaded memory is dropped if the editor moved to another memory while it loaded, or already holds a newer save (a higherversion), so a save made meanwhile is not undone.runBatchForIdsruns that step whether or not the editor session changed. The session check still guards what belongs to the old session: the selection, the notice or error text and the archive Undo.undoArchive) runs the same step instead ofinvalidate()(:1472), with the ids the restores changed. Otherwise the reload after the Archive would leave an open memory showing Archived after the Undo had restored it, and saving it would archive it again.setBusy((current) => (current === action ? "" : current)), so it clears after the change without clearing a different action's flag.## Unreleased: "A memory you open, or already have open, while a bulk change in the Memory Vault is running now shows the new availability once the change finishes, so saving the memory then no longer puts the old places back, and the bulk buttons no longer stay disabled. An open memory without unsaved changes also shows its new status after a bulk change and after an archive Undo, so saving it does not change the status back."Not included
PATCH /notes/:idhas no such check today and the editor does not send a version. It would cover every lost update (another tab, background extraction, a save sent during the change) and needs server, client and error-message work. Separate issue if wanted.C/vault/MemoryVault.tsx). Follow-up:undoArchive, return:1432,finally:1478): the busy flag stays set, so the Select toolbar, each row's Archive and Delete, Remove detail, Rename detail and Undo stay disabled until another action such as a save resets it; the lists do not reload; and if only some memories were restored, the rollback that archives them again (:1454-1462) is skipped.deleteSelected, return:1678): the flag clears (the caller'sfinally,:1884), but the deleted memories stay listed and ticked with no message, a deleted memory opened meanwhile fails to save, and a later bulk action reports the deleted ids as failed.save(), return:1596,finally:1669): choosing Discard in the unsaved-changes dialog while a slow save runs leaves the flag set the same way (from reading the code).renameSection, return:1766,finally:1799): its dialog's Cancel button is disabled while it runs, but Escape still closes the dialog (:2491), so another memory can be opened and the flag stays set the same way.Regression proof
In
tests/long-term-memory-browser.regression.ts, in the existing bulk "Remove availability" case:stagingit stays at 4./notes/batchanswer (page.route,times: 1), opens the memory and edits its title, then releases the answer. It then expects the row's Archive button to be enabled again, a new list request, the title edit kept, and the post-removal availability (one whole-chat chip, no branch chips, 4 chips, the existing assertions). Onstagingthe busy flag never clears and the editor shows 5 chips.GET /notes/:id) once the archive's own reload has finished. Without the Undo step the request never comes.Environment
staging87d1ccadc)upstream/staging5984f0784)Logs, screenshots, or video
From the browser suite with the
/notes/batchanswer delayed by 1.5 s:Additional context
Tracker item OT-9. Found while measuring the browser-suite flakes (OT-8).
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: