fix(dreaming): filter already-emitted entries in light phase to prevent verbatim repeats (fixes #72096)#93008
Conversation
…nt verbatim repeats (fixes openclaw#72096) Light-phase dreaming re-summarized the same short-term recall entries every cycle because it never checked whether an entry was already emitted in a prior cycle. This produced byte-for-byte identical work-summary blocks in DREAMS.md across consecutive cycles. Read the phase signal store before building the light-phase body and skip entries whose is at or after their — meaning they were already emitted and have not been recalled again since. Entries without a prior (first cycle) or with a newer (re-recalled since last emission) are kept.
|
Codex review: needs real behavior proof before merge. Reviewed June 14, 2026, 11:49 AM ET / 15:49 UTC. Summary PR surface: Source +40. Total +40 across 2 files. Reproducibility: yes. Source inspection shows light dreaming ingests before selecting recent entries, and current daily re-ingestion refreshes recall timestamps on later dreaming days; I did not run an overnight live scenario in this read-only review. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Light dreaming should suppress already-emitted unchanged work using stable source/emitted state, with regression coverage for repeated light runs across different dreaming days. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows light dreaming ingests before selecting recent entries, and current daily re-ingestion refreshes recall timestamps on later dreaming days; I did not run an overnight live scenario in this read-only review. Is this the best way to solve the issue? No. The patch is in the right selection boundary, but Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2e240e772b83. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +40. Total +40 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Self-closing to manage open PR capacity. The fix is still valid on current main — can be resubmitted when capacity allows. |
Summary
Light-phase dreaming re-summarized the same short-term recall entries every cycle because it never checked whether an entry was already emitted in a prior cycle. This produced byte-for-byte identical work-summary blocks in DREAMS.md across consecutive cycles (see #72096 for 11 identical cycles across two nights).
The fix reads the phase signal store before building the light-phase body and skips entries whose
lastLightAtis at or after theirlastRecalledAt— meaning they were already emitted and have not been recalled again since.Changes
extensions/memory-core/src/short-term-promotion.ts: Export newreadPhaseSignalEntries()so callers can inspect per-entrylastLightAt/lastRemAttimestamps for deduplication.extensions/memory-core/src/dreaming-phases.ts: InrunLightDreaming, read phase signals and filter out entries that were already emitted in a prior light-phase cycle and not recalled again since. First-cycle entries (nolastLightAt) and re-recalled entries (lastRecalledAt > lastLightAt) are kept.Real behavior proof
6f7fea4c.node scripts/run-vitest.mjs run extensions/memory-core/src/dreaming-phases.test.ts— 46 tests passednode scripts/run-vitest.mjs run extensions/memory-core/src/short-term-promotion.test.ts— 78 tests passedpnpm build— completed successfullygrep -n "readPhaseSignalEntries\|freshEntries\|lastLightAt" extensions/memory-core/src/dreaming-phases.ts— confirmed new filtering logic