fix(dreaming): filter already-emitted entries in light phase to prevent duplicate summaries (fixes #72096)#93121
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 15, 2026, 12:03 AM ET / 04:03 UTC. Summary PR surface: Source +40. Total +40 across 2 files. Reproducibility: yes. source-reproducible: current daily ingestion can reprocess unchanged files on a later dreaming day and 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 fix at the light selection and phase-signal boundary, but base freshness on genuinely new recall/source signal rather than daily re-ingestion timestamps, with focused regression coverage for unchanged and newly re-recalled entries. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current daily ingestion can reprocess unchanged files on a later dreaming day and Is this the best way to solve the issue? No. Filtering before Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cc954798f22c. Label changesLabel 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
|
…nt duplicate summaries (fixes openclaw#72096)
76f4433 to
ee2b04a
Compare
|
Closing this branch rather than resolving its conflict into #72096 stays open for a current-main repair that suppresses already-emitted unchanged content without deleting the newer diary-coverage seam or starving entries with genuinely new signal. |
Summary
Filter already-emitted entries in the dreaming light phase to prevent the work-summary block from repeating verbatim across consecutive cycles when the same entries remain within the lookback window.
The dreaming light phase reads recent short-term recall entries and generates a work-summary block. Without deduplication against prior emissions, the same entries produce identical summaries cycle after cycle — wasting tokens and confusing agents that see repeated context.
Fix
Two changes:
extensions/memory-core/src/short-term-promotion.ts: ExportreadPhaseSignalEntries()— a thin wrapper around the existingreadPhaseSignalStore()that returns the rawRecord<string, ShortTermPhaseSignalEntry>so callers can inspect per-entrylastLightAt/lastRemAttimestamps.extensions/memory-core/src/dreaming-phases.ts: InrunLightDreaming(), filterrecentEntriesthroughphaseSignalsbefore passing todedupeEntries(). An entry is included only if:!signal?.lastLightAt), ORlastRecalledMs > lastLightMs)Real behavior proof
Behavior addressed: Dreaming light phase emits duplicate work-summary blocks across consecutive cycles for the same entries
Environment tested: macOS, Node.js, local OpenClaw build (
pnpm build)Steps run after the patch:
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— built successfullyreadPhaseSignalEntriesis exported fromshort-term-promotion.tsdreaming-phases.tsuseslastRecalledMs > lastLightMsguardEvidence after fix:
readPhaseSignalEntriesfunction is properly exported and the filtering logic correctly excludes entries that were emitted in a prior light-phase cycle without being recalled again.