Upstream: openclaw#45607
Summary
The session-memory hook writes to memory/YYYY-MM-DD-slug.md, but the boot sequence reads memory/YYYY-MM-DD.md. The hook's output is invisible to the agent on startup unless memory_search is working.
Root cause
Two systems built independently with no naming contract:
| System |
Writes to |
Reads from |
| Pre-compaction flush |
memory/YYYY-MM-DD.md (canonical) |
— |
session-memory hook |
memory/YYYY-MM-DD-slug.md (slugged) |
— |
| Boot sequence (AGENTS.md) |
— |
memory/YYYY-MM-DD.md (canonical) |
memory_search |
— |
All memory/*.md (indexed) |
The pre-compaction flush gets this right — it explicitly bans slugged filenames (src/auto-reply/reply/memory-flush.ts:21).
Impact
- Every
/new, /reset, and daily reset (at least once per day per user)
- Silent data loss — no error, users believe memory is preserved
- Only discoverable if
memory_search is unavailable and you check the filesystem
Fix options
- Change hook to append to
memory/YYYY-MM-DD.md (canonical). Simplest, aligns with pre-compaction flush.
- Change boot sequence to glob
memory/YYYY-MM-DD*.md. More permissive.
- Both: canonical for boot visibility, slugged as audit artifact.
Code references
- Hook writes slug:
src/hooks/bundled/session-memory/handler.ts:315
- Boot reads canonical: workspace
AGENTS.md:15
- Pre-compaction bans slugs:
src/auto-reply/reply/memory-flush.ts:21
Upstream: openclaw#45607
Summary
The
session-memoryhook writes tomemory/YYYY-MM-DD-slug.md, but the boot sequence readsmemory/YYYY-MM-DD.md. The hook's output is invisible to the agent on startup unlessmemory_searchis working.Root cause
Two systems built independently with no naming contract:
memory/YYYY-MM-DD.md(canonical)session-memoryhookmemory/YYYY-MM-DD-slug.md(slugged)memory/YYYY-MM-DD.md(canonical)memory_searchmemory/*.md(indexed)The pre-compaction flush gets this right — it explicitly bans slugged filenames (
src/auto-reply/reply/memory-flush.ts:21).Impact
/new,/reset, and daily reset (at least once per day per user)memory_searchis unavailable and you check the filesystemFix options
memory/YYYY-MM-DD.md(canonical). Simplest, aligns with pre-compaction flush.memory/YYYY-MM-DD*.md. More permissive.Code references
src/hooks/bundled/session-memory/handler.ts:315AGENTS.md:15src/auto-reply/reply/memory-flush.ts:21