Skip to content

fix: make MemOS startup recovery non-blocking#1758

Open
leavrcn wants to merge 1 commit into
MemTensor:mainfrom
leavrcn:fix/memos-startup-recovery-nonblocking
Open

fix: make MemOS startup recovery non-blocking#1758
leavrcn wants to merge 1 commit into
MemTensor:mainfrom
leavrcn:fix/memos-startup-recovery-nonblocking

Conversation

@leavrcn
Copy link
Copy Markdown

@leavrcn leavrcn commented May 18, 2026

Summary

  • Make MemOS startup recovery for stale open / dirty closed episodes non-blocking during MemoryCore.init().
  • Schedule startup recovery work in the background so session.open can return promptly even when recovery triggers slow reward/LLM work.
  • Add a focused regression test that locks the init-time non-blocking contract.

Why

Hermes adapter opens a JSON-RPC bridge session during startup. If init() synchronously waits for stale/dirty episode recovery, recovery can call slow scoring paths and prevent session.open from responding before the adapter timeout. The host then kills/restarts bridge processes and can enter a reconnect storm.

Test plan

  • npm --prefix apps/memos-local-plugin test -- tests/unit/startup-recovery.test.ts
  • cd apps/memos-local-plugin && npm run lint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant