Skip to content

Move session summaries off blocking /new#328

Open
VACInc wants to merge 1 commit intoCortexReach:masterfrom
VACInc:vac/async-system-session-memory
Open

Move session summaries off blocking /new#328
VACInc wants to merge 1 commit intoCortexReach:masterfrom
VACInc:vac/async-system-session-memory

Conversation

@VACInc
Copy link

@VACInc VACInc commented Mar 23, 2026

Summary

  • move systemSessionMemory from the blocking command:new hook to async before_reset
  • build the session summary from before_reset messages when available, with sessionFile fallback
  • keep the stored session-summary memory format unchanged
  • add focused coverage for the new async path and keep the hook registration regression check aligned

Why

systemSessionMemory currently does embedding + LanceDB writes inline on /new, which can delay ✅ New session started noticeably for larger sessions.

OpenClaw already exposes before_reset as a fire-and-forget hook with the previous session messages available, so this summary can still be stored without blocking /new.

Tradeoffs

  • the session summary becomes eventually consistent instead of guaranteed before the first post-/new turn
  • if something queries memory immediately after /new, that summary may not be available yet

Testing

  • node --test test/session-summary-before-reset.test.mjs

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