Problem Summary
The memory-core plugin's dreaming feature and session-memory auto-dump mechanism caused severe memory bloat, leading to a Gateway crash with 3.7GB RSS memory usage.
Root Cause Analysis
Issue 1: Dreaming writes without cleanup
- The
.dreams/ directory accumulated 7.8MB of data (149,224 lines in short-term-recall.json alone)
- Dream cleanup mechanism fails silently:
narrative session cleanup failed for rem/light phase: missing scope: operator.admin
- This means dream writes data but never cleans it up β unbounded growth
sqlite-vec unavailable causes vector recall degradation, possibly triggering redundant writes
Issue 2: session-memory plugin dumps raw conversation transcripts
- Error sessions (429 rate limits, OOM crashes, MCP config sessions) get dumped as raw conversation transcripts into the
memory/ directory
- Filenames like
*-provider-finish-reason-error-f.md, *-oom-debug.md, *-figma-mcp-setup.md
- These contain full user/assistant conversation transcripts with zero summarization
- Every startup/heartbeat/memory_search scans these files, burning massive tokens
- No deduplication or cleanup β 10+ redundant files accumulated
Issue 3: No user control
- Dreaming has no config option to disable it until we manually patched
plugins.entries.memory-core.config.dreaming.enabled = false
- The default behavior is write-only with no cleanup, making it a ticking time bomb for all users
Impact
- Memory: Gateway RSS grew from ~500MB to 3.7GB before crashing
- Tokens: Every heartbeat/search loaded 7.8MB of junk, burning 100k+ tokens per invocation
- UX: Agent became slow, unresponsive, and eventually crashed requiring manual restart
Reproduction
- Use OpenClaw with memory-core plugin enabled (default)
- Let it run for ~1 week with regular heartbeats
- Observe
.dreams/ directory growth and memory/ directory filling with session dumps
Suggested Fixes
- Fix dream cleanup permissions β the
missing scope: operator.admin error indicates cleanup lacks proper permissions
- Add a config toggle for dreaming that is OFF by default (or at least document it)
- Cap .dreams file sizes β enforce maximum file size with automatic truncation
- Session-memory should summarize, not dump β raw transcripts in memory directory are useless for recall; only summarized insights should be persisted
- Add TTL or rotation for session dump files
Workaround
Users can manually disable dreaming via config:
{
"plugins": {
"entries": {
"memory-core": {
"config": {
"dreaming": {
"enabled": false
}
}
}
}
}
}
Environment
- OpenClaw 2026.4.15
- macOS 24.5.0 (arm64)
- Model: Qwen3.6-Plus-DogFooding (via IDEALab)
- memory-core plugin with sqlite-vec unavailable
Problem Summary
The
memory-coreplugin's dreaming feature and session-memory auto-dump mechanism caused severe memory bloat, leading to a Gateway crash with 3.7GB RSS memory usage.Root Cause Analysis
Issue 1: Dreaming writes without cleanup
.dreams/directory accumulated 7.8MB of data (149,224 lines inshort-term-recall.jsonalone)narrative session cleanup failed for rem/light phase: missing scope: operator.adminsqlite-vec unavailablecauses vector recall degradation, possibly triggering redundant writesIssue 2: session-memory plugin dumps raw conversation transcripts
memory/directory*-provider-finish-reason-error-f.md,*-oom-debug.md,*-figma-mcp-setup.mdIssue 3: No user control
plugins.entries.memory-core.config.dreaming.enabled = falseImpact
Reproduction
.dreams/directory growth andmemory/directory filling with session dumpsSuggested Fixes
missing scope: operator.adminerror indicates cleanup lacks proper permissionsWorkaround
Users can manually disable dreaming via config:
{ "plugins": { "entries": { "memory-core": { "config": { "dreaming": { "enabled": false } } } } } }Environment