Skip to content

Commit 8c392f0

Browse files
mjamivjalehman
andauthored
fix(dreaming): default storage.mode to "separate" so phase blocks stop polluting daily memory files (#66412)
Merged via squash. Prepared head SHA: 4b1c8ac Co-authored-by: mjamiv <[email protected]> Co-authored-by: jalehman <[email protected]> Reviewed-by: @jalehman
1 parent a1b01f0 commit 8c392f0

6 files changed

Lines changed: 42 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Docs: https://docs.openclaw.ai
2020
- Agents/context + Memory: trim default startup/skills prompt budgets, cap `memory_get` excerpts by default with explicit continuation metadata, and keep QMD reads aligned with the same bounded excerpt contract so long sessions pull less context by default without losing deterministic follow-up reads.
2121
- Matrix/commands: skip DM pairing-store reads on room traffic now that room control-command authorization ignores pairing-store entries, keeping the room path narrower without changing room auth behavior. (#67325) Thanks @gumadeiras.
2222
- Memory-core/dreaming: skip dreaming narrative transcripts from session-store metadata before bootstrap records land so dream diary prompt/prose lines do not pollute session ingestion. (#67315) thanks @jalehman.
23+
- Agents/local models: clarify low-context preflight hints for self-hosted models, point config-backed caps at the relevant OpenClaw setting, and stop suggesting larger models when `agents.defaults.contextTokens` is the real limit. (#66236) Thanks @ImLukeF.
24+
- Dreaming/memory-core: change the default `dreaming.storage.mode` from `inline` to `separate` so Dreaming phase blocks (`## Light Sleep`, `## REM Sleep`) land in `memory/dreaming/{phase}/YYYY-MM-DD.md` instead of being injected into `memory/YYYY-MM-DD.md`. Daily memory files no longer get dominated by structured candidate output, and the daily-ingestion scanner that already strips dream marker blocks no longer has to compete with hundreds of phase-block lines on every run. Operators who want the previous behavior can opt in by setting `plugins.entries.memory-core.config.dreaming.storage.mode: "inline"`. (#66412) Thanks @mjamiv.
2325

2426
## 2026.4.15-beta.1
2527

extensions/memory-core/src/dreaming-phases.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ const LIGHT_DREAMING_TEST_CONFIG: OpenClawConfig = {
2727
dreaming: {
2828
enabled: true,
2929
timezone: "UTC",
30+
// The existing tests in this file were written when "inline" was the
31+
// default storage mode and assert against `memory/<day>.md` directly.
32+
// Pin the storage mode explicitly so they keep covering inline mode
33+
// after the default flipped to "separate" in #66328.
34+
storage: { mode: "inline", separateReports: false },
3035
phases: {
3136
light: {
3237
enabled: true,
@@ -305,6 +310,10 @@ describe("memory-core dreaming phases", () => {
305310
config: {
306311
dreaming: {
307312
enabled: true,
313+
// This test asserts inline-mode side effects on the daily
314+
// file; pin storage explicitly after the default flipped to
315+
// "separate" in #66328.
316+
storage: { mode: "inline", separateReports: false },
308317
phases: {
309318
light: {
310319
enabled: true,

extensions/memory-core/src/dreaming.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ describe("short-term dreaming config", () => {
184184
maxAgeDays: 30,
185185
verboseLogging: false,
186186
storage: {
187-
mode: "inline",
187+
mode: "separate",
188188
separateReports: false,
189189
},
190190
});
@@ -223,7 +223,7 @@ describe("short-term dreaming config", () => {
223223
maxAgeDays: 30,
224224
verboseLogging: true,
225225
storage: {
226-
mode: "inline",
226+
mode: "separate",
227227
separateReports: false,
228228
},
229229
});
@@ -259,7 +259,7 @@ describe("short-term dreaming config", () => {
259259
maxAgeDays: 45,
260260
verboseLogging: false,
261261
storage: {
262-
mode: "inline",
262+
mode: "separate",
263263
separateReports: false,
264264
},
265265
});
@@ -294,7 +294,7 @@ describe("short-term dreaming config", () => {
294294
maxAgeDays: 30,
295295
verboseLogging: false,
296296
storage: {
297-
mode: "inline",
297+
mode: "separate",
298298
separateReports: false,
299299
},
300300
});

extensions/memory-core/src/dreaming.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ export async function runShortTermDreamingPromotionIfTriggered(params: {
615615
bodyLines: reportLines,
616616
nowMs: sweepNowMs,
617617
timezone: params.config.timezone,
618-
storage: params.config.storage ?? { mode: "inline", separateReports: false },
618+
storage: params.config.storage ?? { mode: "separate", separateReports: false },
619619
});
620620
// Generate dream diary narrative from promoted memories.
621621
if (params.subagent && (candidates.length > 0 || applied.applied > 0)) {

src/memory-host-sdk/dreaming.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,31 @@ describe("memory dreaming host helpers", () => {
9090
});
9191
});
9292

93+
it("defaults storage mode to separate so phase blocks do not pollute daily memory files", () => {
94+
const resolved = resolveMemoryDreamingConfig({
95+
pluginConfig: {},
96+
});
97+
98+
expect(resolved.storage).toEqual({
99+
mode: "separate",
100+
separateReports: false,
101+
});
102+
});
103+
104+
it("preserves explicit inline storage mode for callers that opt in", () => {
105+
const resolved = resolveMemoryDreamingConfig({
106+
pluginConfig: {
107+
dreaming: {
108+
storage: {
109+
mode: "inline",
110+
},
111+
},
112+
},
113+
});
114+
115+
expect(resolved.storage.mode).toBe("inline");
116+
});
117+
93118
it("applies top-level dreaming frequency across all phases", () => {
94119
const resolved = resolveMemoryDreamingConfig({
95120
pluginConfig: {

src/memory-host-sdk/dreaming.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
export const DEFAULT_MEMORY_DREAMING_ENABLED = false;
1313
export const DEFAULT_MEMORY_DREAMING_TIMEZONE = undefined;
1414
export const DEFAULT_MEMORY_DREAMING_VERBOSE_LOGGING = false;
15-
export const DEFAULT_MEMORY_DREAMING_STORAGE_MODE = "inline";
15+
export const DEFAULT_MEMORY_DREAMING_STORAGE_MODE = "separate";
1616
export const DEFAULT_MEMORY_DREAMING_SEPARATE_REPORTS = false;
1717
export const DEFAULT_MEMORY_DREAMING_FREQUENCY = "0 3 * * *";
1818
export const DEFAULT_MEMORY_DREAMING_PLUGIN_ID = "memory-core";

0 commit comments

Comments
 (0)