惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
GbyAI
GbyAI
B
Blog
F
Fortinet All Blogs
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
Google Developers Blog
A
About on SuperTechFans
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale Blog
B
Blog RSS Feed

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: re-ingest daily memory during dreaming (#76359) (tha...
obviyus · 2026-05-05 · via Recent Commits to openclaw:main

@@ -72,6 +72,7 @@ type RunPhaseIfTriggeredParams = {

7272

);

7373

const LIGHT_SLEEP_EVENT_TEXT = "__openclaw_memory_core_light_sleep__";

7474

const REM_SLEEP_EVENT_TEXT = "__openclaw_memory_core_rem_sleep__";

75+

const MEMORY_DAY_RE = /^\d{4}-\d{2}-\d{2}$/;

7576

const DAILY_MEMORY_FILENAME_RE = /^(\d{4}-\d{2}-\d{2})\.md$/;

7677

const DAILY_INGESTION_STATE_RELATIVE_PATH = path.join("memory", ".dreams", "daily-ingestion.json");

7778

const DAILY_INGESTION_SCORE = 0.62;

@@ -386,6 +387,7 @@ type DailyIngestionBatch = {

386387

type DailyIngestionFileState = {

387388

mtimeMs: number;

388389

size: number;

390+

lastDreamingDayIngested?: string;

389391

};

390392391393

type DailyIngestionState = {

@@ -417,9 +419,11 @@ function normalizeDailyIngestionState(raw: unknown): DailyIngestionState {

417419

if (!Number.isFinite(mtimeMs) || mtimeMs < 0 || !Number.isFinite(size) || size < 0) {

418420

continue;

419421

}

422+

const lastDreamingDayIngested = normalizeMemoryDay(file.lastDreamingDayIngested);

420423

files[key] = {

421424

mtimeMs: Math.floor(mtimeMs),

422425

size: Math.floor(size),

426+

...(lastDreamingDayIngested ? { lastDreamingDayIngested } : {}),

423427

};

424428

}

425429

return {

@@ -428,6 +432,14 @@ function normalizeDailyIngestionState(raw: unknown): DailyIngestionState {

428432

};

429433

}

430434435+

function normalizeMemoryDay(value: unknown): string | undefined {

436+

if (typeof value !== "string") {

437+

return undefined;

438+

}

439+

const day = value.trim();

440+

return MEMORY_DAY_RE.test(day) ? day : undefined;

441+

}

442+431443

async function readDailyIngestionState(workspaceDir: string): Promise<DailyIngestionState> {

432444

const statePath = resolveDailyIngestionStatePath(workspaceDir);

433445

try {

@@ -1065,6 +1077,7 @@ async function collectDailyIngestionBatches(params: {

10651077

lookbackDays: number;

10661078

limit: number;

10671079

nowMs: number;

1080+

ingestionDreamingDay: string;

10681081

state: DailyIngestionState;

10691082

}): Promise<DailyIngestionCollectionResult> {

10701083

const memoryDir = path.join(params.workspaceDir, "memory");

@@ -1119,11 +1132,15 @@ async function collectDailyIngestionBatches(params: {

11191132

previous !== undefined &&

11201133

previous.mtimeMs === fingerprint.mtimeMs &&

11211134

previous.size === fingerprint.size;

1122-

if (!unchanged) {

1123-

changed = true;

1124-

} else {

1135+

const previousDreamingDay = normalizeMemoryDay(previous?.lastDreamingDayIngested);

1136+

if (unchanged && previousDreamingDay === params.ingestionDreamingDay) {

1137+

nextFiles[relativePath] = {

1138+

...fingerprint,

1139+

lastDreamingDayIngested: previousDreamingDay,

1140+

};

11251141

continue;

11261142

}

1143+

changed = true;

1127114411281145

const raw = await fs.readFile(filePath, "utf-8").catch((err: unknown) => {

11291146

if ((err as NodeJS.ErrnoException)?.code === "ENOENT") {

@@ -1155,6 +1172,10 @@ async function collectDailyIngestionBatches(params: {

11551172

}

11561173

batches.push({ day: file.day, results });

11571174

total += results.length;

1175+

nextFiles[relativePath] = {

1176+

...fingerprint,

1177+

lastDreamingDayIngested: params.ingestionDreamingDay,

1178+

};

11581179

if (total >= totalCap) {

11591180

break;

11601181

}

@@ -1189,14 +1210,15 @@ async function ingestDailyMemorySignals(params: {

11891210

timezone?: string;

11901211

}): Promise<void> {

11911212

const state = await readDailyIngestionState(params.workspaceDir);

1213+

const ingestionDayBucket = formatMemoryDreamingDay(params.nowMs, params.timezone);

11921214

const collected = await collectDailyIngestionBatches({

11931215

workspaceDir: params.workspaceDir,

11941216

lookbackDays: params.lookbackDays,

11951217

limit: params.limit,

11961218

nowMs: params.nowMs,

1219+

ingestionDreamingDay: ingestionDayBucket,

11971220

state,

11981221

});

1199-

const ingestionDayBucket = formatMemoryDreamingDay(params.nowMs, params.timezone);

12001222

for (const batch of collected.batches) {

12011223

await recordShortTermRecalls({

12021224

workspaceDir: params.workspaceDir,