Summary
memory-core nightly dreaming can leave repeated warning noise after dream narrative generation, because detached narrative subagent runs either time out or finish, then cleanup calls subagent.deleteSession({ sessionKey }) from the plugin path without sufficient gateway scope. The cleanup failure is logged as:
memory-core: narrative session cleanup failed for <phase> phase: missing scope: operator.admin
This appears to be an upstream plugin/runtime scope bug rather than a local configuration problem.
Environment
- OpenClaw:
2026.4.24 (cbcfdf6)
- Platform: macOS / Darwin arm64
- Plugin:
memory-core
- Feature: nightly dreaming / dream narrative generation
- Relevant config:
{
"plugins.entries.memory-core.config.dreaming": {
"enabled": true,
"frequency": "0 3 * * *",
"timezone": "Asia/Shanghai",
"verboseLogging": true
}
}
Observed behavior
On nightly dreaming runs, memory promotion itself completes, but log noise remains from narrative generation/cleanup.
Examples from ~/.openclaw/logs/gateway.err.log:
2026-04-27T03:00:16.523+08:00 [plugins] memory-core: narrative generation ended with status=timeout for light phase.
2026-04-27T03:00:16.523+08:00 [plugins] memory-core: narrative session cleanup failed for light phase: missing scope: operator.admin
...
2026-04-27T03:00:30.611+08:00 [plugins] memory-core: narrative generation ended with status=timeout for rem phase.
2026-04-27T03:00:30.611+08:00 [plugins] memory-core: narrative session cleanup failed for rem phase: missing scope: operator.admin
Counts from two recent days:
DAY 2026-04-26
7 managed dreaming cron could not be reconciled
0 narrative generation ended with status=timeout
19 narrative session cleanup failed
DAY 2026-04-27
0 managed dreaming cron could not be reconciled
19 narrative generation ended with status=timeout
19 narrative session cleanup failed
Source-level finding
In the installed bundle, dist/dreaming-narrative-*.js contains:
const NARRATIVE_TIMEOUT_MS = 15e3;
...
const result = await params.subagent.waitForRun({
runId,
timeoutMs: NARRATIVE_TIMEOUT_MS
});
if (result.status !== "ok") {
params.logger.warn(`memory-core: narrative generation ended with status=${result.status} for ${params.data.phase} phase.`);
return;
}
...
finally {
if (params.subagent) try {
await params.subagent.deleteSession({ sessionKey });
} catch (cleanupErr) {
params.logger.warn(`memory-core: narrative session cleanup failed for ${params.data.phase} phase: ${formatErrorMessage(cleanupErr)}`);
}
}
In dist/dreaming-*.js, cron-triggered dreaming detaches narratives:
const detachNarratives = params.trigger === "cron";
...
if (params.detachNarratives) queueMicrotask(() => {
generateAndAppendDreamNarrative(...).catch(() => void 0);
});
So the failure chain appears to be:
- Managed dreaming cron runs successfully.
- It launches detached narrative generation for light/rem/deep phases across workspaces.
- Narrative subagent waits only 15 seconds; some runs time out.
- The cleanup path calls
subagent.deleteSession from a plugin/internal context that lacks operator.admin.
- Cleanup failures are logged as warnings, creating recurring noise.
Expected behavior
- Dreaming narrative cleanup should be best-effort and should not warn repeatedly because an internal plugin caller lacks
operator.admin.
- Internal memory-core cleanup should either have the required scope, use a scoped runtime cleanup API, or downgrade known cleanup permission failures when the artifact is harmless.
- The 15s narrative timeout should perhaps be configurable, or timeout logs should be less noisy if narrative generation is optional.
Impact
- Memory promotion itself appears successful (
dreaming promotion complete ... failed=0).
- The problem creates repeated warning noise in
gateway.err.log and makes health checks look worse than they are.
- Potentially leaves narrative temp session metadata/transcripts until scrub/doctor cleanup handles them.
Suggested fix direction
- Ensure
memory-core internal narrative cleanup can delete its own temporary dreaming-narrative-* sessions without requiring an external operator.admin gateway client scope; or
- Make
deleteSession best-effort with explicit handling for missing scope: operator.admin in this plugin path; and
- Consider making
NARRATIVE_TIMEOUT_MS configurable or increasing it for cron/detached narrative generation.
Summary
memory-corenightly dreaming can leave repeated warning noise after dream narrative generation, because detached narrative subagent runs either time out or finish, then cleanup callssubagent.deleteSession({ sessionKey })from the plugin path without sufficient gateway scope. The cleanup failure is logged as:This appears to be an upstream plugin/runtime scope bug rather than a local configuration problem.
Environment
2026.4.24 (cbcfdf6)memory-core{ "plugins.entries.memory-core.config.dreaming": { "enabled": true, "frequency": "0 3 * * *", "timezone": "Asia/Shanghai", "verboseLogging": true } }Observed behavior
On nightly dreaming runs, memory promotion itself completes, but log noise remains from narrative generation/cleanup.
Examples from
~/.openclaw/logs/gateway.err.log:Counts from two recent days:
Source-level finding
In the installed bundle,
dist/dreaming-narrative-*.jscontains:In
dist/dreaming-*.js, cron-triggered dreaming detaches narratives:So the failure chain appears to be:
subagent.deleteSessionfrom a plugin/internal context that lacksoperator.admin.Expected behavior
operator.admin.Impact
dreaming promotion complete ... failed=0).gateway.err.logand makes health checks look worse than they are.Suggested fix direction
memory-coreinternal narrative cleanup can delete its own temporarydreaming-narrative-*sessions without requiring an externaloperator.admingateway client scope; ordeleteSessionbest-effort with explicit handling formissing scope: operator.adminin this plugin path; andNARRATIVE_TIMEOUT_MSconfigurable or increasing it for cron/detached narrative generation.