

























@@ -19,11 +19,7 @@ import {
1919resolveMemoryRemDreamingConfig,
2020} from "openclaw/plugin-sdk/memory-core-host-status";
2121import { writeDailyDreamingPhaseBlock } from "./dreaming-markdown.js";
22-import {
23-buildNarrativeSessionKey,
24-generateAndAppendDreamNarrative,
25-type NarrativePhaseData,
26-} from "./dreaming-narrative.js";
22+import { generateAndAppendDreamNarrative, type NarrativePhaseData } from "./dreaming-narrative.js";
2723import { asRecord, formatErrorMessage, normalizeTrimmedString } from "./dreaming-shared.js";
2824import {
2925filterLiveShortTermRecallEntries,
@@ -1696,17 +1692,6 @@ async function runRemDreaming(params: {
16961692}
16971693}
169816941699-async function deleteNarrativeSessionBestEffort(
1700-subagent: Parameters<typeof generateAndAppendDreamNarrative>[0]["subagent"],
1701-sessionKey: string,
1702-): Promise<void> {
1703-try {
1704-await subagent.deleteSession({ sessionKey });
1705-} catch {
1706-// Cleanup is best-effort; request-scoped runtimes can throw synchronously.
1707-}
1708-}
1709-17101695export async function runDreamingSweepPhases(params: {
17111696workspaceDir: string;
17121697pluginConfig?: Record<string, unknown>;
@@ -1733,19 +1718,6 @@ export async function runDreamingSweepPhases(params: {
17331718nowMs: sweepNowMs,
17341719detachNarratives: params.detachNarratives,
17351720});
1736-// Defensive cleanup: ensure the light-phase narrative session is deleted even if
1737-// generateAndAppendDreamNarrative's primary cleanup was skipped due to an error.
1738-// Skip when narratives are detached: the queued subagent run hasn't read the
1739-// session yet, so eager cleanup would race the writer and silently drop the
1740-// diary entry. The narrative function does its own cleanup in finally{}.
1741-if (params.subagent && !params.detachNarratives) {
1742-const lightSessionKey = buildNarrativeSessionKey({
1743-workspaceDir: params.workspaceDir,
1744-phase: "light",
1745-nowMs: sweepNowMs,
1746-});
1747-await deleteNarrativeSessionBestEffort(params.subagent, lightSessionKey);
1748-}
17491721}
1750172217511723const rem = resolveMemoryRemDreamingConfig({
@@ -1762,16 +1734,6 @@ export async function runDreamingSweepPhases(params: {
17621734nowMs: sweepNowMs,
17631735detachNarratives: params.detachNarratives,
17641736});
1765-// Defensive cleanup: ensure the REM-phase narrative session is deleted.
1766-// Skip when narratives are detached (see light-phase comment above).
1767-if (params.subagent && !params.detachNarratives) {
1768-const remSessionKey = buildNarrativeSessionKey({
1769-workspaceDir: params.workspaceDir,
1770-phase: "rem",
1771-nowMs: sweepNowMs,
1772-});
1773-await deleteNarrativeSessionBestEffort(params.subagent, remSessionKey);
1774-}
17751737}
17761738}
17771739此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。