From c9e6f371e417ff3636ebf3ca6ce38f7b8e30b53c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 27 Apr 2026 10:45:49 +0100 Subject: [PATCH] fix(memory-core): quiet request-scoped fallback --- CHANGELOG.md | 2 +- extensions/memory-core/src/dreaming-narrative.test.ts | 5 ++++- extensions/memory-core/src/dreaming-narrative.ts | 2 +- extensions/memory-core/src/dreaming-phases.test.ts | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f10bf3e9e3..93b71d44bbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ Docs: https://docs.openclaw.ai ### Fixes -- Memory-core/dreaming: skip subagent session cleanup after request-scoped narrative fallback and remove duplicate phase-level cleanup, preventing false cleanup warnings when no subagent session was created. Fixes #67152. Thanks @jsompis. +- Memory-core/dreaming: treat request-scoped narrative fallback as expected, skip session cleanup when no subagent run was created, and remove duplicate phase-level cleanup so fallback no longer emits warning noise. Fixes #67152. Thanks @jsompis. - Config/doctor: stop masking unknown-key validation diagnostics such as `agents.defaults.llm`, and have `openclaw doctor --fix` remove the retired `agents.defaults.llm` timeout block. Thanks @aidiffuser. - CLI/plugins: preserve unversioned ClawHub install specs so `plugins update` can follow newer ClawHub releases instead of pinning to the initially resolved version. Fixes #63010; supersedes #58426. Thanks @kangsen1234 and @robinspt. - Memory-core/subagents: tag plugin-created subagent sessions with their plugin owner so dreaming narrative cleanup can delete its own ephemeral sessions without granting broad admin session deletion. Fixes #72712. Thanks @BSG2000. diff --git a/extensions/memory-core/src/dreaming-narrative.test.ts b/extensions/memory-core/src/dreaming-narrative.test.ts index fff1bad4fd8..02a5db7ec20 100644 --- a/extensions/memory-core/src/dreaming-narrative.test.ts +++ b/extensions/memory-core/src/dreaming-narrative.test.ts @@ -719,7 +719,8 @@ describe("generateAndAppendDreamNarrative", () => { const content = await fs.readFile(path.join(workspaceDir, "DREAMS.md"), "utf-8"); expect(content).toContain("API endpoints need authentication"); - expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining("request-scoped")); + expect(logger.info).toHaveBeenCalledWith(expect.stringContaining("request-scoped")); + expect(logger.warn).not.toHaveBeenCalledWith(expect.stringContaining("request-scoped")); expect(logger.warn).not.toHaveBeenCalledWith(expect.stringContaining(workspaceDir)); expect(logger.warn).not.toHaveBeenCalledWith( expect.stringContaining("narrative session cleanup failed"), @@ -749,6 +750,8 @@ describe("generateAndAppendDreamNarrative", () => { const content = await fs.readFile(path.join(workspaceDir, "DREAMS.md"), "utf-8"); expect(content).toContain("A durable candidate surfaced."); + expect(logger.info).toHaveBeenCalledWith(expect.stringContaining("request-scoped")); + expect(logger.warn).not.toHaveBeenCalledWith(expect.stringContaining("request-scoped")); expect(subagent.deleteSession).not.toHaveBeenCalled(); }); diff --git a/extensions/memory-core/src/dreaming-narrative.ts b/extensions/memory-core/src/dreaming-narrative.ts index dbefb315a7f..36d17b4da17 100644 --- a/extensions/memory-core/src/dreaming-narrative.ts +++ b/extensions/memory-core/src/dreaming-narrative.ts @@ -171,7 +171,7 @@ async function startNarrativeRunOrFallback(params: { nowMs: params.nowMs, timezone: params.timezone, }); - params.logger.warn( + params.logger.info( `memory-core: narrative generation used fallback for ${params.data.phase} phase because subagent runtime is request-scoped.`, ); } catch (fallbackErr) { diff --git a/extensions/memory-core/src/dreaming-phases.test.ts b/extensions/memory-core/src/dreaming-phases.test.ts index 703e9a6285a..12faa007bbf 100644 --- a/extensions/memory-core/src/dreaming-phases.test.ts +++ b/extensions/memory-core/src/dreaming-phases.test.ts @@ -319,6 +319,8 @@ describe("memory-core dreaming phases", () => { const dreams = await fs.readFile(path.join(workspaceDir, "DREAMS.md"), "utf-8"); expect(dreams).toContain("Move backups to S3 Glacier."); expect(logger.error).not.toHaveBeenCalled(); + expect(logger.info).toHaveBeenCalledWith(expect.stringContaining("request-scoped")); + expect(logger.warn).not.toHaveBeenCalledWith(expect.stringContaining("request-scoped")); expect(logger.warn).not.toHaveBeenCalledWith( expect.stringContaining("narrative session cleanup failed"), );