Skip to content

Commit 10c6c0c

Browse files
authored
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
1 parent 1602d45 commit 10c6c0c

6 files changed

Lines changed: 453 additions & 133 deletions

File tree

0 commit comments

Comments
 (0)