Skip to content

fix(memory): keep dreaming consolidation within project scope - #115721

Merged
steipete merged 2 commits into
mainfrom
feat/memory-consolidation-project-grouping
Jul 29, 2026
Merged

steipete merged 2 commits into
mainfrom
feat/memory-consolidation-project-grouping

Conversation

@steipete

@steipete steipete commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Related: #115438

What Problem This Solves

Fixes an issue where dreaming consolidation considered short-term promotion candidates from every project in one model pass. Similar claims from unrelated projects could therefore be merged into one durable memory entry, and the resulting entry could lose the project scope established by #115438.

Why This Change Was Made

Consolidation candidates are now partitioned by their exact joined project-key set, including a separate global group, and groups run in deterministic key order through isolated model passes. Promoted text and annotations remain code-built. The validator rejects any merge or supersession that consumes a prior entry from another project group, and the existing append-only fallback preserves eligible memories when a grouped rewrite is rejected. The combined plan is also code-applied before acceptance so aggregate loss and size limits still hold across all groups.

Consolidation preimage and summary handling moved into a focused artifact module so the runtime decision path remains within the repository's file-size boundary. This change is AI-assisted and was reviewed with the repository autoreview workflow.

During landing, current main changed the deep-dreaming promotion default to 0.75 but left the /dreaming status assertion at 0.8. This PR aligns that stale assertion with the canonical resolver output so the merge gate remains green.

User Impact

Dreaming can promote and consolidate memories for multiple projects in one sweep without combining facts across project boundaries. Project-scoped entries retain their exact project annotation, global entries remain unscoped, and unsafe model output falls back to deterministic append-only promotion.

Evidence

  • Focused Vitest proof on the rebased head: 111 tests passed across dreaming consolidation, project grouping, promotion metadata, and short-term promotion.
  • Mixed global/alpha/beta corpus test proves three isolated prompts in deterministic global/alpha/beta order and verifies each applied entry's code-built annotation.
  • Cross-project response test proves an alpha merge targeting a beta-tagged prior entry is rejected after all isolated group passes complete.
  • Aggregate-budget regression proves individually valid groups fall back when their combined code-applied plan exceeds the configured memory budget.
  • Exact rebased-head changed gate passed on Blacksmith Testbox: formatting, dead exports, extension and extension-test typechecks, extension lint, SDK/boundary guards, database-first guard, and runtime import-cycle checks.
  • Final Codex autoreview reported no accepted/actionable findings after the aggregate-budget finding was fixed (0.90 confidence).
  • Red-main repair proof: the exact final-head focused run passed 119/119 tests, including /dreaming status; the combined seven-file changed gate passed dead-code, extension and extension-test typechecks, extension lint, and architecture/storage guards; the focused assertion autoreview was clean (0.99 confidence).

@steipete steipete self-assigned this Jul 29, 2026
@steipete
steipete marked this pull request as ready for review July 29, 2026 07:09
@openclaw-barnacle openclaw-barnacle Bot added extensions: memory-core Extension: memory-core size: L maintainer Maintainer-authored PR labels Jul 29, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper review was skipped at operator direction after the 10-minute cap expired with no posted verdict (queue backlog).

Pre-land gates used instead: exact-head CI is green for 333b3d8128225fb2f16d603affc9db274caecfeb after the two unrelated Git-fetch failures passed on their single rerun, and the final repository autoreview reported no accepted/actionable findings (0.90 confidence).

@steipete
steipete force-pushed the feat/memory-consolidation-project-grouping branch from 333b3d8 to 88c647a Compare July 29, 2026 07:39
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Jul 29, 2026
@steipete
steipete force-pushed the feat/memory-consolidation-project-grouping branch from da47db1 to 1e89fa0 Compare July 29, 2026 08:13
@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Jul 29, 2026
@steipete
steipete merged commit ed6010e into main Jul 29, 2026
95 of 96 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the feat/memory-consolidation-project-grouping branch July 29, 2026 08:27
vincentkoc added a commit that referenced this pull request Jul 29, 2026
* origin/main:
  fix(zalo): stop provider startup after gateway shutdown (#115763)
  fix(agents): bound completed background process retention (#115760)
  fix(plugins): bound hook execution and retire stale registrations (#115695)
  fix(ui): collapse custodian startup error gap (#115720)
  fix(gateway): reload edited hook transforms (#107875)
  refactor: centralize channel streaming config hints (#115739)
  fix(msteams): finalize sent replies after dispatch (#82354)
  fix(cron): deliver explicitly configured failure alerts (#115762)
  fix(hooks): resolve inbound claim conversation once (#115491)
  refactor: retire legacy provider and secret paths (#115655)
  fix(memory): reject malformed QMD result entries (#115705)
  fix(diagnostics): keep internal thinking out of telemetry [AI] (#115261)
  fix(ui): localize remaining control surfaces (#115730)
  fix(gateway): prevent model owner mismatch after plugin activation (#115747)
  fix(agents): run reply hooks for restart recovery (#115711)
  fix(cron): initialize detached hook run sessions (#115765)
  fix(ios): keep stop available for staged voice notes (#115744)
  fix(doctor): preserve config includes during cleanup (#115723)
  fix(memory): keep dreaming consolidation within project scope (#115721)
  fix(discord): keep tool rows under verbose progress (#111947)

# Conflicts:
#	ui/src/pages/custodian/custodian-surface.ts
#	ui/src/styles/custodian.css
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
…aw#115721)

* fix(memory): isolate consolidation by project

* test(memory): align dreaming status threshold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant