mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1303] [Issue]: Long-Term Memory doesn't register the Engine's refresh hook for embedding changes #664
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#664
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 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1303
Originally assigned to: @Promansis on GitHub.
Summary
When a connection or agent save changes Long-Term Memory's embedding configuration, the Engine calls
refresh({ signal })on thelong-term-memory:runtimeservice. The Engine added this in Pasta-Devs/Marinara-Engine#7148, for Pasta-Devs/Marinara-Engine#7042. LTM never registersrefresh, so every such save shows:Updating doesn't help, because no LTM version registers the hook. The whole vault is then re-embedded inline during the next chat's recall.
Affected package
long-term-memory(Long-Term Memory) 1.4.23Expected behavior
LTM implements
refresh. It brings the recall index up to date for the new embedding source while the save is in progress, and returns{ status: "refreshed" }. The Engine then shows "Configuration saved and Long-Term Memory indexes refreshed."Actual behavior
recall,recordPromptAcceptedandwithVaultMutation, but notrefresh.refreshand setsX-Marinara-LTM-Refresh: unavailable(long-term-memory-runtime.ts L74-L77),```` and the client shows the warning toast (api-client.ts L273-L278).loadOrRebuildLongTermMemoryIndexessees aspaceIdmismatch andtryUpgradeSemanticIndexre-embeds the whole vault inside recall (rebuild.ts L59-L82).````` That happens under the vault lock and within the agent call timeout, so the first reply after a switch waits for it.autoUpgradeFailuresguard turns semantic search off for that space until a manual rebuild or a restart. Recall silently falls back to lexical-only.Steps to reproduce
X-Marinara-LTM-Refresh: unavailable.Environment
stagingatecd62a2e4678d82fae753dd19f0f15cfbe48bba0)stagingat11c8a563e7ef33b03442909814366f11330e1aad)Logs, screenshots, or video
Toast text from the Engine's
agents.longTermMemory.embeddingRefresh.unavailablestring (en.json L68).Additional context
Minimal fix
In
rebuild.ts, export a small helper.clearAutoUpgradeFailure,getUsableEmbeddingStateandresolvePackageEmbeddingAdapterare already available in that module.In
server-entry.ts, addrefreshto thelong-term-memory:runtimeservice:loadOrRebuildLongTermMemoryIndexesdoes nothing when the index already matches the new space. This matters because the Engine also callsrefreshwhen only the request identity changes, such as credentials, whilespaceIdstays the same (long-term-memory-runtime.ts L47-L48).``````tryUpgradeSemanticIndexis swallowed, and the user would see "refreshed" while semantic search is actually off. With it, the Engine reportsfailed, and the save itself still succeeds.withLtmVaultLockand honorssignal. The Engine reports a timeout astimeout, and because cancellation doesn't set the guard, the next recall retries.refresh: the index is rebuilt with B'sspaceIdand the result is{ status: "refreshed" }. Call it again: there is no second rebuild. With an adapter that fails,refreshrejects.Related
spaceId, so they don't trigger this path.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: