mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1377] [Issue]: Long-Term Memory UI: remove duplicated code, repeated fetches and unused locale keys #705
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#705
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 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1377
Originally assigned to: @Promansis on GitHub.
Summary
The Long-Term Memory client carries several byte-identical copies of the same code, three definitions of the same queries, a
lazy()import that splits nothing, Settings actions that fetch the same data two or three times, and about 155 locale keys that nothing references. Removing them changes nothing users see, except that one loading flash goes away.Affected package
long-term-memory1.4.31 client, underpackages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/. Line numbers are atcdb583a95, before the folder moves in #1376.Expected behavior
One copy of each shared piece of code, one definition per query, each Settings action fetches each resource once, and every locale key is used.
Actual behavior
sectionCopy(46 lines) is defined twice, identically:MemoryVault.tsx:1054-1099and:1350-1395.MemoryVault.tsx:236-242,SourcesWorkspace.tsx:143-149,:474-480.chatModeLabel(SourcesWorkspace.tsx:436) andmodeName(:940) are byte-identical.MemorySettings.tsx:953,LtmWorkspace.tsx:215,SourcesWorkspace.tsx:212/818/2827/3073/3548,TargetPicker.tsx:180,MemoryVault.tsx:432.confirm()wrappers atActivityView.tsx:593andMemorySettings.tsx:102, plus an inlinewindow.confirmatLongTermMemoryDetail.tsx:239./settingsis queried atMemoryVault.tsx:1708,SourcesWorkspace.tsx:1687andMemorySettings.tsx:268./scope-targetsis queried atMemoryVault.tsx:1591,SourcesWorkspace.tsx:1679andActivityView.tsx:703; all three share one cache key, but the Vault parses it as its ownVaultScopeTargetstype (:164), so one cache entry has two declared shapes./notes/:id/derivedis cached under two keys (MemoryVault.tsx:1787,SourcesWorkspace.tsx:1086).React.lazyatLongTermMemoryDetail.tsx:94-99splits nothing, because esbuild builds one output file without--splitting. It only adds a loading flash.MemorySettings.tsx:719-736), reset (:781-787) and delete-all (:824-835) callinvalidateQueries, which already waits for active queries to refetch, then call.refetch()again. PassingqueryKeys.roottogether with child keys restarts overlapping fetches, and most query functions ignore the abort signal, so the cancelled requests still go out. This contradicts the rule atapi.ts:226.ui.*keys inlocales/en.jsonhave no literal or template-prefix reference.Steps to reproduce
sectionCopyblocks: they are identical.ArrowRighthandlers across the feature's.tsxfiles: 9 sites.Environment
staging)upstream/staging39a5c5cfb; LTM files unchanged sincecdb583a95)@tanstack/query-core5.100.9 source)Logs, screenshots, or video
Not applicable.
Minimal fix
Deletions only:
sectionCopy; both places use oneconst.display-labels.ts; the three copies call it.chatModeLabelandmodeName; calllocalizedLabel(mode, t, labelKeys.mode)(display-labels.ts:39,129).nextTabIndex(key, index, length)toshared-controls.tsx; the 9 handlers call it.confirm()(the one withdestructive) toshared-controls.tsx; delete the Activity copy and use it for the inlinewindow.confirm.settingsQuery,scopeTargetsQuery(chatId)(one response type; the Vault reads the fields it needs from it) andderivedNotesQuery(id)fromapi.ts; the screens use them.lazy/SuspenseinLongTermMemoryDetail.tsxand importMemoryVaultdirectly. Keep zod: it validates review state read from localStorage..refetch()calls, read errors withqueryClient.getQueryState(key), and drop eitherqueryKeys.rootor the child keys it already covers.Proof: a small Engine-free test for
nextTabIndex; the browser test stays green; the duplicate counts above each drop to one.Additional context
After #1376, so these deletions land in the moved files. The shared
errorMessagehelper is part of #1375.Template check