fix(memory): record structured dreaming outcomes#97723
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 7:19 AM ET / 11:19 UTC. Summary PR surface: Source +93, Tests +95, Generated 0, Other 0. Total +188 across 10 files. Reproducibility: yes. Source inspection shows current main lacks Review metrics: 3 noteworthy metrics.
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. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one maintainer-approved additive Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main lacks Is this the best way to solve the issue? Yes as a bounded implementation shape, pending maintainer acceptance. The two-state contract is more conservative than the overlapping broader taxonomy in #97705, with crash recovery left to #97692. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cfd8ba8fc81d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +93, Tests +95, Generated 0, Other 0. Total +188 across 10 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 automerge |
|
🦞✅ Approver: What merged:
Automerge notes:
The automerge loop is complete. Automerge progress:
|
|
@clawsweeper approve |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
|
@clawsweeper approve |
Summary: - Merged fix(memory): record structured dreaming outcomes after ClawSweeper review. Automerge notes: - PR branch already contained follow-up commit before automerge: chore(plugin-sdk): update surface budgets Validation: - ClawSweeper review passed for head 9fa7d20. - Required merge gates passed before the squash merge. Prepared head SHA: 9fa7d20 Review: openclaw#97723 (comment) Co-authored-by: momothemage <[email protected]> Approved-by: momothemage
Summary: - Merged fix(memory): record structured dreaming outcomes after ClawSweeper review. Automerge notes: - PR branch already contained follow-up commit before automerge: chore(plugin-sdk): update surface budgets Validation: - ClawSweeper review passed for head 9fa7d20. - Required merge gates passed before the squash merge. Prepared head SHA: 9fa7d20 Review: openclaw#97723 (comment) Co-authored-by: momothemage <[email protected]> Approved-by: momothemage
Summary: - Merged fix(memory): record structured dreaming outcomes after ClawSweeper review. Automerge notes: - PR branch already contained follow-up commit before automerge: chore(plugin-sdk): update surface budgets Validation: - ClawSweeper review passed for head 9fa7d20. - Required merge gates passed before the squash merge. Prepared head SHA: 9fa7d20 Review: openclaw#97723 (comment) Co-authored-by: momothemage <[email protected]> Approved-by: momothemage
Summary: - Merged fix(memory): record structured dreaming outcomes after ClawSweeper review. Automerge notes: - PR branch already contained follow-up commit before automerge: chore(plugin-sdk): update surface budgets Validation: - ClawSweeper review passed for head 9fa7d20. - Required merge gates passed before the squash merge. Prepared head SHA: 9fa7d20 Review: openclaw#97723 (comment) Co-authored-by: momothemage <[email protected]> Approved-by: momothemage
Closes #97690
AI-assisted: yes, authored with Codex.
What Problem This Solves
Fixes an issue where users and operators reading memory dreaming event logs could see artifact-write records but could not tell whether a dreaming phase completed successfully or failed. Failed dreaming phases were visible in unstructured logs, but not in
memory/.dreams/events.jsonl, so dashboards, doctor checks, and other structured consumers had no reliable event-log outcome to inspect.Why This Change Was Made
This adds a conservative public
MemoryDreamOutcomecontract with the two outcomes the current runtime can accurately emit:completedandfailed. New successful dreaming completion events now includeoutcome: "completed"; existing logs withoutoutcomeremain compatible and should be read as legacy completed events. Runtime failure paths now append best-effort failed dreaming events for the specific phase that failed (light,rem, ordeep) without publishing unresolvedpartial,timed_out, orinterruptedsemantics that belong with the broader crash-recovery design in #97692.Compatibility And Data Model
This is an additive JSONL event-shape change, not a migration. Existing
memory.dream.completedrecords withoutoutcomestill parse through the public SDK and should be interpreted as legacy successful completion records. The newerrorfield is optional and is only written on failed outcomes. Failed-outcome event writes are best-effort and guarded so diagnostic logging cannot mask the original dreaming failure or stop later workspace processing.Because
MemoryHostDreamCompletedEventis exported through public plugin SDK entrypoints, this PR also updates the pinned plugin SDK surface budgets for the newly exportedMemoryDreamOutcometype and its deprecated compatibility re-export surface.User Impact
Memory event-log consumers can distinguish successful dreaming events from failed dreaming runs without parsing plain-text logs. Existing event logs and existing readers remain compatible because
outcomeis optional, and diagnostic outcome writes are guarded so an event-log write failure does not mask the original dreaming failure or stop later workspace processing.Evidence
Real failed dreaming run, using the actual
recordShortTermRecallsandrunShortTermDreamingPromotionIfTriggeredpath withDREAMS.mdsymlinked so report writing refuses to overwrite it. Workspace path is redacted.Targeted validation run locally on this branch:
Behavior proof added in tests:
memory-events.test.tsverifies new successful dreaming events includeoutcome: "completed"and legacy completion events withoutoutcomestill read correctly.dreaming.test.tsexercises a real deep-dreaming failure path by makingDREAMS.mda symlink that report writing refuses to overwrite, then verifiesevents.jsonlcontains amemory.dream.completedevent withphase: "deep",outcome: "failed", and the structured error text.memory-host-events.test.tscovers the public SDK helper path with the new outcome field.plugin-sdk-surface-report.test.tscovers the pinned public SDK surface budgets after exporting the new outcome type.Note:
pnpm check:changed -- <changed files>could not run locally because the installed Crabbox binary is0.16.0and the current Testbox delegation requires>= 0.22.0; the targeted lanes above were run directly instead.