From 650dc59b6f16e764a245a91131046fab39f33d44 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 26 Apr 2026 01:30:31 +0100 Subject: [PATCH] fix: skip checkpoint transcripts in memory dreaming --- extensions/memory-core/src/dreaming-phases.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions/memory-core/src/dreaming-phases.ts b/extensions/memory-core/src/dreaming-phases.ts index cbbe7d92414..f1737dd2c40 100644 --- a/extensions/memory-core/src/dreaming-phases.ts +++ b/extensions/memory-core/src/dreaming-phases.ts @@ -91,6 +91,7 @@ const SESSION_INGESTION_MAX_MESSAGES_PER_FILE = 80; const SESSION_INGESTION_MIN_MESSAGES_PER_FILE = 12; const SESSION_INGESTION_MAX_TRACKED_MESSAGES_PER_SESSION = 4096; const SESSION_INGESTION_MAX_TRACKED_SCOPES = 2048; +const SESSION_CHECKPOINT_TRANSCRIPT_FILENAME_RE = /\.checkpoint\..+\.jsonl$/i; const GENERIC_DAY_HEADING_RE = /^(?:(?:mon|monday|tue|tues|tuesday|wed|wednesday|thu|thur|thurs|thursday|fri|friday|sat|saturday|sun|sunday)(?:,\s+)?)?(?:(?:jan|january|feb|february|mar|march|apr|april|may|jun|june|jul|july|aug|august|sep|sept|september|oct|october|nov|november|dec|december)\s+\d{1,2}(?:st|nd|rd|th)?(?:,\s*\d{4})?|\d{1,2}[/-]\d{1,2}(?:[/-]\d{2,4})?|\d{4}[/-]\d{2}[/-]\d{2})$/i; const MANAGED_DAILY_DREAMING_BLOCKS = [ @@ -613,6 +614,10 @@ function buildSessionStateKey(agentId: string, absolutePath: string): string { return `${agentId}:${sessionPathForFile(absolutePath)}`; } +function isCheckpointSessionTranscriptPath(absolutePath: string): boolean { + return SESSION_CHECKPOINT_TRANSCRIPT_FILENAME_RE.test(path.basename(absolutePath)); +} + function buildSessionRenderedLine(params: { agentId: string; sessionPath: string; @@ -726,6 +731,9 @@ async function collectSessionIngestionBatches(params: { cronRunTranscriptPaths: new Set(), }; for (const absolutePath of files) { + if (isCheckpointSessionTranscriptPath(absolutePath)) { + continue; + } const normalizedPath = normalizeSessionTranscriptPathForComparison(absolutePath); sessionFiles.push({ agentId,