From bf320fb037d907bd16d26efaf080f869c1a8b784 Mon Sep 17 00:00:00 2001 From: Josh Lehman Date: Thu, 16 Apr 2026 11:43:22 -0700 Subject: [PATCH] fix: tighten memory-core dreaming types --- extensions/memory-core/src/dreaming-phases.test.ts | 4 ++-- extensions/memory-core/src/dreaming-phases.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/extensions/memory-core/src/dreaming-phases.test.ts b/extensions/memory-core/src/dreaming-phases.test.ts index 76f970bbc9a..0d9e6f75528 100644 --- a/extensions/memory-core/src/dreaming-phases.test.ts +++ b/extensions/memory-core/src/dreaming-phases.test.ts @@ -249,8 +249,8 @@ describe("memory-core dreaming phases", () => { }); expect(subagent.deleteSession).toHaveBeenCalledTimes(2); - expect(subagent.deleteSession.mock.calls[0]?.[0]).toEqual({ sessionKey: expectedSessionKey }); - expect(subagent.deleteSession.mock.calls[1]?.[0]).toEqual({ sessionKey: expectedSessionKey }); + expect(subagent.deleteSession).toHaveBeenNthCalledWith(1, { sessionKey: expectedSessionKey }); + expect(subagent.deleteSession).toHaveBeenNthCalledWith(2, { sessionKey: expectedSessionKey }); }); it("does not re-ingest managed light dreaming blocks from daily notes", async () => { diff --git a/extensions/memory-core/src/dreaming-phases.ts b/extensions/memory-core/src/dreaming-phases.ts index bcae2c04b67..bc0bbde1878 100644 --- a/extensions/memory-core/src/dreaming-phases.ts +++ b/extensions/memory-core/src/dreaming-phases.ts @@ -684,7 +684,7 @@ async function appendSessionCorpusLines(params: { async function collectSessionIngestionBatches(params: { workspaceDir: string; - cfg?: OpenClawConfig; + cfg?: DreamingHostConfig; lookbackDays: number; nowMs: number; timezone?: string; @@ -972,7 +972,7 @@ async function collectSessionIngestionBatches(params: { async function ingestSessionTranscriptSignals(params: { workspaceDir: string; - cfg?: OpenClawConfig; + cfg?: DreamingHostConfig; lookbackDays: number; nowMs: number; timezone?: string; @@ -1652,11 +1652,11 @@ export async function runDreamingSweepPhases(params: { nowMs?: number; }): Promise { // Normalize nowMs once so all phase timestamps and narrative session keys are consistent. - const sweepNowMs = Number.isFinite(params.nowMs) ? params.nowMs : Date.now(); + const sweepNowMs: number = Number.isFinite(params.nowMs) ? (params.nowMs as number) : Date.now(); const light = resolveMemoryLightDreamingConfig({ pluginConfig: params.pluginConfig, - cfg: params.cfg, + cfg: params.cfg as Parameters[0]["cfg"], }); if (light.enabled && light.limit > 0) { await runLightDreaming({ @@ -1683,7 +1683,7 @@ export async function runDreamingSweepPhases(params: { const rem = resolveMemoryRemDreamingConfig({ pluginConfig: params.pluginConfig, - cfg: params.cfg, + cfg: params.cfg as Parameters[0]["cfg"], }); if (rem.enabled && rem.limit > 0) { await runRemDreaming({