fix(memory): stop light dreaming from restaging stale summaries#97446
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 4:50 AM ET / 08:50 UTC. Summary PR surface: Source +47, Tests +115. Total +162 across 4 files. Reproducibility: yes. source-level: current main ranks live short-term recall entries within the lookback before using prior light-emission state, and the linked report plus PR proof show the repeated-cycle behavior. I did not run a live overnight cycle in this read-only review. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused memory-core repair after maintainer acceptance of the session-state risk and exact-head proof/checks remain green. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main ranks live short-term recall entries within the lookback before using prior light-emission state, and the linked report plus PR proof show the repeated-cycle behavior. I did not run a live overnight cycle in this read-only review. Is this the best way to solve the issue? Yes. The patch uses the existing phase-signal store and short-term recall freshness boundary instead of adding config or a parallel state shape, and it covers the prior cross-day freshness blocker. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9c95abd49d45. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +47, Tests +115. Total +162 across 4 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
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
…claw#97446) * fix(memory): stop restaging stale light dreams * fix(memory): preserve cross-day light freshness
…claw#97446) * fix(memory): stop restaging stale light dreams * fix(memory): preserve cross-day light freshness
…claw#97446) * fix(memory): stop restaging stale light dreams * fix(memory): preserve cross-day light freshness
…claw#97446) * fix(memory): stop restaging stale light dreams * fix(memory): preserve cross-day light freshness
Closes #72096
What Problem This Solves
Fixes an issue where users running memory-core dreaming would see the same light-phase work summary staged again in later cycles when the underlying daily memory content had not changed.
Why This Change Was Made
Light dreaming now filters already-emitted recall entries unless the recall freshness moved past the last light emission. Repeated same-query daily signals keep their original freshness when the stored snippet is unchanged, including cross-day re-ingestion, so unchanged daily ingestion no longer makes stale content look new while real same-day note edits can still be staged.
User Impact
DREAMS.md light-phase sections stop repeating unchanged work-summary blocks across hourly or cross-night cycles, reducing duplicate memory noise without hiding newly edited daily-note content from later light dreaming cycles.
Evidence
Claim proved: unchanged light dreaming candidates are not restaged in a later cycle, cross-day unchanged daily re-ingestion increments
dailyCountwithout refreshinglastRecalledAt, and same-day daily-note content changes are still restaged.Duplicate PR checks:
gh search prs --repo openclaw/openclaw --state open --match title,body -- "72096","Dreaming light-phase work summary repeats", and"light dreaming lastLightAt"returned no open PR coverage before opening this PR.Real behavior proof: ran
runDreamingSweepPhasesfromextensions/memory-core/src/dreaming-phases.tsagainst a temporary memory workspace and temporary SQLite-backed memory-core state store on PR head5c3f7ed6f3ce3ea4566f29e7402792d6a3af729a. This exercised the real light-dreaming runtime write path intomemory/2026-04-05.mdwith inline dreaming output; no private local OpenClaw home, credentials, or user memory were used.Redacted terminal output from the repeated light-dreaming cycle:
{ "proof": "PR #97446 real light-dreaming repeated-cycle proof", "head": "5c3f7ed6f3ce3ea4566f29e7402792d6a3af729a", "workspace": "<temp-workspace>", "stateDir": "<temp-state>", "cycles": [ { "label": "cycle 1: initial daily note", "now": "2026-04-05T10:01:00.000Z", "candidateCount": 1, "noNotableUpdates": false, "lightBlock": "- Candidate: Added primary issue extraction for pain notifications.; Updated signals cron notification style.\n - confidence: 0.62\n - evidence: memory/2026-04-05.md:3-4\n - recalls: 0\n - status: staged", "logs": [ "[info] memory-core: light dreaming staged 1 candidate(s) [workspace=<temp-workspace>]." ] }, { "label": "cycle 2: unchanged note", "now": "2026-04-05T11:01:00.000Z", "candidateCount": 0, "noNotableUpdates": true, "lightBlock": "- No notable updates.", "logs": [] }, { "label": "cycle 3: edited note", "now": "2026-04-05T12:01:00.000Z", "candidateCount": 1, "noNotableUpdates": false, "lightBlock": "- Candidate: Added primary issue extraction for pain notifications.; Updated signals cron notification style.; Documented the shared pain notification issue.\n - confidence: 0.62\n - evidence: memory/2026-04-05.md:3-5\n - recalls: 0\n - status: staged", "logs": [ "[info] memory-core: light dreaming staged 1 candidate(s) [workspace=<temp-workspace>]." ] } ] }Observed result: the first cycle staged one light candidate, the second unchanged cycle wrote
- No notable updates.withcandidateCount: 0, and the third cycle after editing the daily note staged the updated candidate again.Commands / artifacts:
git diff --checkpassed.node scripts/run-vitest.mjs extensions/memory-core/src/dreaming-phases.test.ts extensions/memory-core/src/short-term-promotion.test.tspassed: 2 files, 130 tests.corepack pnpm exec oxfmt --check --threads=1 extensions/memory-core/src/dreaming-phases.ts extensions/memory-core/src/dreaming-phases.test.ts extensions/memory-core/src/short-term-promotion.ts extensions/memory-core/src/short-term-promotion.test.tspassed.node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfopassed, matching the previous failing CIcheck-test-typesextension-test lane.python .agents\skills\autoreview\scripts\autoreview --mode localpassed withautoreview clean: no accepted/actionable findings reportedafter the cross-day freshness fix.Not tested / proof gaps: did not run an overnight wall-clock dreaming cycle or broad local repo checks. The added real behavior proof uses a temporary workspace and calls the shipped memory-core light-dreaming runtime entry directly to exercise the repeated-cycle write path without exposing private local memory.