Files
openclaw/extensions/memory-core
Peter Steinberger 10c6c0cb98 fix(memory-core): dream diary stays empty because narrative sessions have no agent scope (#115069)
* fix(memory-core): scope dream narrative sessions to their owning agent

Dreaming narratives built unscoped subagent session keys
(`dreaming-narrative-<phase>-<hash>`). Sessions live in per-agent SQLite
stores, so the plugin-runtime ownership pre-check could not resolve a store
and every narrative call failed with "Cannot resolve SQLite session scope
without an agent id" — the whole diary pipeline produced nothing while the
sweep still logged "dreaming promotion complete".

The agent id was available all along: `resolveMemoryDreamingWorkspaces`
returns it per workspace and the hook context carries the triggering agent.
Both were dropped. Session keys are now `agent:<id>:dreaming-narrative-...`,
while runIds stay unscoped so the orphan-transcript scrub marker still
matches. An unexpected narrative failure now writes the same dated fallback
diary entry the other failure branches write, and the promotion summary
warns instead of informing when every workspace failed.

* fix(memory-core): narrow the narrative export surface and type the sweep test double

* test(memory-core): drop the now-unused missing-path helper

* fix(memory-core): scope the narrative run id and keep empty sweeps a no-op

* fix(memory-core): route the ownerless narrative fallback through detached dispatch
2026-07-28 08:15:37 -04:00
..
2026-06-04 21:40:44 -04:00