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

推荐订阅源

D
Docker
U
Unit 42
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
罗磊的独立博客
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
L
LangChain Blog
Engineering at Meta
Engineering at Meta
量子位
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
A
About on SuperTechFans
Y
Y Combinator Blog

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(memory-core): route dreaming corpus through session c...
jalehman · 2026-06-25 · via Recent Commits to openclaw:main

@@ -58,10 +58,6 @@ function isDreamingNarrativeSessionKeyLike(value: unknown): boolean {

5858

return typeof value === "string" && isDreamingNarrativeSessionStoreKey(value);

5959

}

606061-

function hasCronRunSessionKey(value: unknown): boolean {

62-

return typeof value === "string" && isCronRunSessionKey(value);

63-

}

64-6561

function normalizeComparablePath(pathname: string): string {

6662

const resolved = path.resolve(pathname);

6763

return process.platform === "win32" ? resolved.toLowerCase() : resolved;

@@ -163,6 +159,7 @@ function resolveSessionStoreTranscriptCorpusPath(

163159

function classifySessionEntry(

164160

sessionKey: string,

165161

entry: SessionEntry,

162+

cronGeneratedSessionKeys: ReadonlySet<string>,

166163

): {

167164

generatedByDreamingNarrative: boolean;

168165

generatedByCronRun: boolean;

@@ -171,10 +168,69 @@ function classifySessionEntry(

171168

generatedByDreamingNarrative:

172169

isDreamingNarrativeSessionStoreKey(sessionKey) ||

173170

isDreamingNarrativeSessionKeyLike(entry.spawnedBy),

174-

generatedByCronRun: isCronRunSessionKey(sessionKey) || hasCronRunSessionKey(entry.spawnedBy),

171+

generatedByCronRun: cronGeneratedSessionKeys.has(sessionKey),

175172

};

176173

}

177174175+

function readParentSessionKeys(entry: SessionEntry | undefined): string[] {

176+

const keys = new Set<string>();

177+

for (const value of [entry?.parentSessionKey, entry?.spawnedBy]) {

178+

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

179+

continue;

180+

}

181+

const trimmed = value.trim();

182+

if (trimmed) {

183+

keys.add(trimmed);

184+

}

185+

}

186+

return [...keys];

187+

}

188+189+

function collectCronGeneratedSessionKeys(

190+

summaries: readonly SessionEntrySummary[],

191+

): ReadonlySet<string> {

192+

// Build the cron-generated closure once so active entries and archive

193+

// artifacts share the same lineage classification.

194+

const entriesByKey = new Map(summaries.map((summary) => [summary.sessionKey, summary.entry]));

195+

const cronGeneratedKeys = new Set<string>();

196+

const cache = new Map<string, boolean>();

197+

const resolving = new Set<string>();

198+199+

const isCronGenerated = (sessionKey: string, entry: SessionEntry | undefined): boolean => {

200+

if (isCronRunSessionKey(sessionKey)) {

201+

cache.set(sessionKey, true);

202+

cronGeneratedKeys.add(sessionKey);

203+

return true;

204+

}

205+

const cached = cache.get(sessionKey);

206+

if (cached !== undefined) {

207+

return cached;

208+

}

209+

if (resolving.has(sessionKey)) {

210+

return false;

211+

}

212+213+

resolving.add(sessionKey);

214+

const generated = readParentSessionKeys(entry).some(

215+

(parentKey) =>

216+

// Parent rows can be pruned before child rows; a cron-shaped parent key

217+

// still carries cron lineage without requiring a store entry.

218+

isCronRunSessionKey(parentKey) || isCronGenerated(parentKey, entriesByKey.get(parentKey)),

219+

);

220+

resolving.delete(sessionKey);

221+

cache.set(sessionKey, generated);

222+

if (generated) {

223+

cronGeneratedKeys.add(sessionKey);

224+

}

225+

return generated;

226+

};

227+228+

for (const summary of summaries) {

229+

isCronGenerated(summary.sessionKey, summary.entry);

230+

}

231+

return cronGeneratedKeys;

232+

}

233+178234

function isRegularSessionTranscriptFile(absPath: string): boolean {

179235

try {

180236

return fsSync.lstatSync(absPath).isFile();

@@ -187,6 +243,7 @@ function toSessionStoreCorpusEntry(

187243

agentId: string,

188244

sessionsDir: string,

189245

summary: SessionEntrySummary,

246+

cronGeneratedSessionKeys: ReadonlySet<string>,

190247

): SessionTranscriptCorpusEntry | null {

191248

const sessionFile = resolveSessionStoreTranscriptCorpusPath(agentId, sessionsDir, summary.entry);

192249

if (!sessionFile || !isUsageCountedSessionTranscriptFileName(path.basename(sessionFile))) {

@@ -200,7 +257,11 @@ function toSessionStoreCorpusEntry(

200257

return null;

201258

}

202259

const sessionKey = summary.sessionKey.trim();

203-

const classification = classifySessionEntry(summary.sessionKey, summary.entry);

260+

const classification = classifySessionEntry(

261+

summary.sessionKey,

262+

summary.entry,

263+

cronGeneratedSessionKeys,

264+

);

204265

return {

205266

agentId,

206267

artifactKind: "active-session",

@@ -299,11 +360,13 @@ export function listSessionTranscriptCorpusEntriesForAgentSync(

299360

const activeEntryOwnersByPath = new Map<string, string>();

300361

const artifactDirsByPath = new Map<string, string>();

301362

rememberArtifactDir(artifactDirsByPath, sessionsDir);

302-

for (const summary of listSessionEntries({

363+

const sessionEntries = listSessionEntries({

303364

agentId: normalizedAgentId,

304365

hydrateSkillPromptRefs: false,

305366

storePath,

306-

})) {

367+

});

368+

const cronGeneratedSessionKeys = collectCronGeneratedSessionKeys(sessionEntries);

369+

for (const summary of sessionEntries) {

307370

const sessionKey = isSharedFixedStore

308371

? summary.sessionKey

309372

: canonicalizeMainSessionAlias({

@@ -316,7 +379,12 @@ export function listSessionTranscriptCorpusEntriesForAgentSync(

316379

sessionKey,

317380

...(isSharedFixedStore ? {} : { fallbackAgentId: normalizedAgentId }),

318381

});

319-

const entry = toSessionStoreCorpusEntry(ownerAgentId, sessionsDir, summary);

382+

const entry = toSessionStoreCorpusEntry(

383+

ownerAgentId,

384+

sessionsDir,

385+

summary,

386+

cronGeneratedSessionKeys,

387+

);

320388

if (!entry) {

321389

continue;

322390

}