fix: harden metadata readiness and add persistence self-heal reconcile

This commit is contained in:
Youzini-afk
2026-03-29 21:39:58 +08:00
parent 16e1427fe1
commit 4bf571ba37
3 changed files with 126 additions and 5 deletions

View File

@@ -263,6 +263,17 @@ export async function onBeforeCombinePromptsController(runtime) {
}
export function onMessageReceivedController(runtime) {
const loadState = runtime.getGraphPersistenceState?.()?.loadState || "";
if (
loadState === "loading" ||
loadState === "shadow-restored" ||
loadState === "blocked"
) {
runtime.syncGraphLoadFromLiveContext?.({
source: "message-received-reconcile",
});
}
if (runtime.getCurrentGraph()) {
if (
runtime.getGraphPersistenceState()?.pendingPersist &&