Skip to content

Move session summaries off blocking /new#328

Merged
rwmjhb merged 1 commit intoCortexReach:masterfrom
VACInc:vac/async-system-session-memory
Mar 27, 2026
Merged

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

Conversation

@VACInc
Copy link
Contributor

@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

@AliceLJY
Copy link
Collaborator

session summary 从同步 command:new 移到异步 before_reset,方向对,beta.10 的 OpenClaw hook 模型也更适合这种做法。eventual consistency 对 /new 场景可以接受。

麻烦 rebase 到最新 master,需要确认的测试:

  1. 新的 test/session-summary-before-reset.test.mjs
  2. test/plugin-manifest-regression.mjs 的 hook 注册更新
  3. 手动跑一次 /new 确认延迟没有恶化

rebase + 测试过后可以合 👍

@VACInc
Copy link
Contributor Author

VACInc commented Mar 25, 2026

Found a bug in OpenClaw preventing it from succeeding. All other tests passed except for on OpenClaw's side; I've opened a PR:
openclaw/openclaw#53872

@rwmjhb rwmjhb merged commit e6c4e02 into CortexReach:master Mar 27, 2026
5 checks passed
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.

3 participants