Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion apps/memos-local-plugin/core/pipeline/memory-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1933,7 +1933,14 @@ export function createMemoryCore(
// gateway reload would close SQLite while reflect / reward is
// mid-flush, producing `SQLITE_MISUSE` noise on the way down.
try {
await startupRecoveryPromise;
// Bound the wait: a slow / flaky LLM during startup recovery of a
// large dirty episode must not hold shutdown hostage until the
// systemd kill timer (15 Aug 2026 stop-sigterm wedge: SIGTERM at
// 08:00:23, SIGKILL at 08:10:23). Recovery is resumable — dirty
// episodes carry rewardDirty.failedAttempts and the periodic
// rescore re-runs them — so nothing is lost by proceeding after a
// short grace. Fast init→shutdown races still get their grace.
await withTimeout(startupRecoveryPromise, 15_000, "startup_recovery_shutdown_timeout");
} catch {
/* already logged inside the recovery promise */
}
Expand Down