-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: memory-core Dreaming normalized recall artifacts silently deletes daily memory files (memory/YYYY-MM-DD.md) #84882
Copy link
Copy link
Open
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.ClawSweeper needs more reporter information before it can verify this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.Decent issue quality, but reproduction details are still incomplete.
Description
Metadata
Metadata
Assignees
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.ClawSweeper needs more reporter information before it can verify this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.Decent issue quality, but reproduction details are still incomplete.
Type
Fields
Priority
None yet
[Bug]: memory-core Dreaming
normalized recall artifactssilently deletes daily memory files (memory/YYYY-MM-DD.md)Bug type
Behavior bug (silent data loss)
Summary
The
memory-coreDreaming pipeline stepnormalized recall artifacts before dreaming (rewrote recall store)silently deletes daily memory log files (memory/YYYY-MM-DD.md) without logging the deletion. 46 daily memory files dating from March through May 18, 2026 vanished between the evening of May 19 and the morning of May 20, 2026.Reproduction
This was discovered post-hoc in a production OpenClaw instance. The exact reproduction steps are unclear because the deletion is silent, but the timeline and evidence are:
memory-coreplugin and Dreaming enabled (cron:0 3 * * *)memory/YYYY-MM-DD.md) accumulate over days/weeks via HeartbeatEvidence
Files existed and were read by Dreaming
events.jsonlproves the files existed and were successfully read by the Dreaming process on subsequent nights:Files no longer exist
Only
memory/2026-05-19.md(created 19:36 on May 19) andmemory/2026-05-20.md(created 17:30 on May 20) survive. All files from2026-05-15.mdthrough2026-05-18.md(and older dating back to March) have vanished.short-term-recall.jsonstill references deleted filesThe recall store contains 14 references to
memory/2026-05-15.md— dangling pointers to a file that no longer exists.Dreaming log at time of disappearance
Related known bug: #64068
The
normalized recall artifactsstep previously causedrecallCountto reset to 0 for all entries (bug #64068, fixed in PR #71695). This proves the step performs destructive rewrites of the recall store. The current bug appears to be another destructive side effect of the same normalization process — this time deleting the source daily memory files themselves.Related: #68408
PR #68408 documents that Dreaming writes "managed blocks" directly into daily memory files (
memory/YYYY-MM-DD.md) when using inline storage mode. The normalization step that rewrites these files could corrupt or empty them.Related: #82928
Issue #82928 documents
ENOENTerrors when readingmemory/2026-05-15.md— the same missing-file symptom, but treated as a logging issue rather than a data loss issue.Not caused by user/agent action
Full audit of 143 session transcripts from May 19-20 found:
writetool calls onmemory/2026-05-*pathsedittool calls onmemory/2026-05-*pathsexeccommands containingrm,mv,unlink, ordeletetargetingmemory/pathsYYYY-MM-DD-*.md(excludingYYYY-MM-DD.md) — correctly protects daily filesevents.jsonlNot caused by Dreaming cleanup
The
dreaming cleanupstep only archives orphan session transcripts (.jsonlfiles renamed to.deleted.TIMESTAMP). It does not touchmemory/daily files. Source code confirms:fs.rename(transcriptPath, archivedPath)only operates onagents/main/sessions/*.jsonl.Root Cause Hypothesis
The
normalized recall artifacts before dreaming (rewrote recall store)step at 03:00:06 rewrites the short-term recall store and, based on PR #68408, also rewrites daily memory files to strip/manage Dreaming blocks. During this rewrite, daily memory files are either:This is functionally identical to bug #64068 (where normalization reset
recallCountto 0) — destructive side effects of the normalization rewrite step.Impact
short-term-recall.jsonstill points to deleted filesEnvironment
0 3 * * *Europe/Berlinseparate(writing tomemory/dreaming/light/,rem/,deep/)Suggested Fix
normalizeRecallArtifactsfunction should never delete daily memory files — it should only modify the recall storeevents.jsonlwith the reasonmemory/YYYY-MM-DD.md) should be read-only during Dreaming — Dreaming writes tomemory/dreaming/, not to daily files