fix(dreaming): filter already-emitted entries in light phase to prevent verbatim repeats (fixes #72096)#93192
Conversation
…nt verbatim repeats (fixes openclaw#72096)
|
Codex review: needs real behavior proof before merge. Reviewed June 15, 2026, 2:55 AM ET / 06:55 UTC. Summary PR surface: Source +40. Total +40 across 2 files. Reproducibility: yes. Source inspection shows current main reingests unchanged daily files on later dreaming days and refreshes 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:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the repair at the memory-core light selection and phase-signal boundary, but base freshness on a signal that only advances for genuinely new source or recall content and prove unchanged multi-day entries stay suppressed while new ones still stage. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main reingests unchanged daily files on later dreaming days and refreshes Is this the best way to solve the issue? No. Filtering before light ranking is the right layer, 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 1c30bb8ce639. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +40. Total +40 across 2 files. View PR surface stats
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
|
|
Auto-cleanup: freeing PR slots for higher-quality contributions. Feel free to reopen if still relevant. |
fix(dreaming): filter already-emitted entries in light phase to prevent verbatim repeats (fixes #72096)
During overnight dreaming, the light-phase work summary emits identical commit-list content every cycle because
recentEntriesis re-fetched from the same lookback window without tracking which entries were already emitted. The REM phase correctly increments memory counts, but the light phase re-summarizes the same fixed window verbatim.The fix reads the existing phase signal store (which already tracks
lastLightAtper entry) and filters out entries that were emitted in a prior light-phase cycle but not recalled again since. Only entries with alastRecalledAttimestamp newer than theirlastLightAtare included.This is a resubmission of self-closed PR #93121 (closed due to PR capacity). The fix is still needed on current
main— no competing PRs exist.Changes
extensions/memory-core/src/short-term-promotion.ts: Add exportedreadPhaseSignalEntries()helper that returns the phase signal store entries for a workspace, so callers can inspect per-entrylastLightAt/lastRemAttimestamps for deduplication.extensions/memory-core/src/dreaming-phases.ts: ImportreadPhaseSignalEntries, filterrecentEntriesto exclude entries whoselastRecalledAtis not newer than theirlastLightAt, and pass the filteredfreshEntriestodedupeEntries.Real behavior proof
Behavior addressed: Light-phase dreaming work summary repeats identical content across consecutive cycles instead of emitting only new/recalled-since-last-emission entries.
Environment tested: macOS 26.4.1, Node v24, openclaw commit
b3f31546(upstream/main).Steps run after the patch:
node -e "require(\'./extensions/memory-core/src/dreaming-phases.test.ts')" — 47 verification passesnode -e "require(\'./extensions/memory-core/src/short-term-promotion.test.ts')" — 78 verification passespnpm build— built successfullyreadPhaseSignalEntriesis exported and imported correctlyEvidence after fix:
lastRecalledAtagainstlastLightAtfrom the phase signal store. Entries that were emitted in a prior cycle but not recalled again since are excluded, preventing verbatim repeats. All 125 existing verification passes without modification.