Description
Dreaming narrative sub-sessions (dreaming-narrative-light, dreaming-narrative-deep, dreaming-narrative-rem) are spawned during the memory dreaming process but never cleaned up after completion. Over time, these orphaned sessions accumulate and consume disk space.
Steps to Reproduce
- Enable memory-core dreaming plugin (
dreaming.enabled: true)
- Let the gateway run for a few days with dreaming cron active
- Check sessions: you will see dozens of
dreaming-narrative-* sessions that are all done/failed but never deleted
Expected Behavior
Dreaming narrative sub-sessions should be automatically cleaned up after their content has been processed (e.g., cleanup: "delete" in the spawn options, or a TTL-based cleanup mechanism).
Actual Behavior
Each dreaming run creates 3 sub-sessions (light, deep, rem) that persist indefinitely. After running for weeks, this results in hundreds of orphaned session files.
Evidence
From source code (dreaming-phases-DW9aQqXD.js), the narrative session key is built deterministically:
dreaming-narrative-${phase}-${workspaceHash}-${nowMs}
Each invocation creates a new unique session, but there is no corresponding cleanup logic. The buildNarrativeSessionKey function generates keys with timestamps but nothing ever removes them.
Environment
- OpenClaw version: latest (installed via brew)
- OS: macOS (Darwin 25.4.0, arm64)
- Node: v25.9.0
- Plugin: memory-core with
dreaming.enabled: true
Suggested Fix
Either:
- Add
cleanup: "delete" to the dreaming narrative sub-agent spawn call
- Or add a TTL-based cleanup that removes dreaming sessions older than N hours after completion
Description
Dreaming narrative sub-sessions (
dreaming-narrative-light,dreaming-narrative-deep,dreaming-narrative-rem) are spawned during the memory dreaming process but never cleaned up after completion. Over time, these orphaned sessions accumulate and consume disk space.Steps to Reproduce
dreaming.enabled: true)dreaming-narrative-*sessions that are alldone/failedbut never deletedExpected Behavior
Dreaming narrative sub-sessions should be automatically cleaned up after their content has been processed (e.g.,
cleanup: "delete"in the spawn options, or a TTL-based cleanup mechanism).Actual Behavior
Each dreaming run creates 3 sub-sessions (light, deep, rem) that persist indefinitely. After running for weeks, this results in hundreds of orphaned session files.
Evidence
From source code (
dreaming-phases-DW9aQqXD.js), the narrative session key is built deterministically:Each invocation creates a new unique session, but there is no corresponding cleanup logic. The
buildNarrativeSessionKeyfunction generates keys with timestamps but nothing ever removes them.Environment
dreaming.enabled: trueSuggested Fix
Either:
cleanup: "delete"to the dreaming narrative sub-agent spawn call