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

推荐订阅源

大猫的无限游戏
大猫的无限游戏
J
Java Code Geeks
小众软件
小众软件
D
Docker
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
V2EX
博客园 - 叶小钗
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
IT之家
IT之家
博客园 - 司徒正美
M
MIT News - Artificial intelligence
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
C
Check Point 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): make file index publication atomic · opencla...
jalehman · 2026-06-19 · via Recent Commits to openclaw:main

@@ -22,6 +22,7 @@ import {

2222

type MemorySource,

2323

} from "openclaw/plugin-sdk/memory-core-host-engine-storage";

2424

import { MAX_TIMER_TIMEOUT_MS, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";

25+

import { runSqliteImmediateTransactionSync } from "openclaw/plugin-sdk/sqlite-runtime";

2526

import {

2627

MEMORY_BATCH_FAILURE_LIMIT,

2728

recordMemoryBatchFailure,

@@ -747,53 +748,56 @@ export abstract class MemoryManagerEmbeddingOps extends MemoryManagerSyncOps {

747748

vectorReady: boolean,

748749

): void {

749750

const now = Date.now();

750-

this.clearIndexedFileData(entry.path, source);

751-

for (let i = 0; i < chunks.length; i++) {

752-

const chunk = chunks[i];

753-

const embedding = embeddings[i] ?? [];

754-

const id = hashText(

755-

`${source}:${entry.path}:${chunk.startLine}:${chunk.endLine}:${chunk.hash}:${model}`,

756-

);

757-

this.db

758-

.prepare(

759-

`INSERT INTO memory_index_chunks (id, path, source, start_line, end_line, hash, model, text, embedding, updated_at)

760-

VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

761-

ON CONFLICT(id) DO UPDATE SET

762-

hash=excluded.hash,

763-

model=excluded.model,

764-

text=excluded.text,

765-

embedding=excluded.embedding,

766-

updated_at=excluded.updated_at`,

767-

)

768-

.run(

769-

id,

770-

entry.path,

771-

source,

772-

chunk.startLine,

773-

chunk.endLine,

774-

chunk.hash,

775-

model,

776-

chunk.text,

777-

JSON.stringify(embedding),

778-

now,

751+

runSqliteImmediateTransactionSync(this.db, () => {

752+

this.clearIndexedFileData(entry.path, source);

753+

for (let i = 0; i < chunks.length; i++) {

754+

const chunk = chunks[i];

755+

const embedding = embeddings[i] ?? [];

756+

const id = hashText(

757+

`${source}:${entry.path}:${chunk.startLine}:${chunk.endLine}:${chunk.hash}:${model}`,

779758

);

780-

if (vectorReady && embedding.length > 0) {

781-

replaceMemoryVectorRow({

782-

db: this.db,

783-

tableName: VECTOR_TABLE,

784-

id,

785-

embedding,

786-

});

787-

}

788-

if (this.fts.enabled && this.fts.available) {

789759

this.db

790760

.prepare(

791-

`INSERT INTO ${FTS_TABLE} (text, id, path, source, model, start_line, end_line)\n` +

792-

` VALUES (?, ?, ?, ?, ?, ?, ?)`,

761+

`INSERT INTO memory_index_chunks (id, path, source, start_line, end_line, hash, model, text, embedding, updated_at)

762+

VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

763+

ON CONFLICT(id) DO UPDATE SET

764+

hash=excluded.hash,

765+

model=excluded.model,

766+

text=excluded.text,

767+

embedding=excluded.embedding,

768+

updated_at=excluded.updated_at`,

793769

)

794-

.run(chunk.text, id, entry.path, source, model, chunk.startLine, chunk.endLine);

770+

.run(

771+

id,

772+

entry.path,

773+

source,

774+

chunk.startLine,

775+

chunk.endLine,

776+

chunk.hash,

777+

model,

778+

chunk.text,

779+

JSON.stringify(embedding),

780+

now,

781+

);

782+

if (vectorReady && embedding.length > 0) {

783+

replaceMemoryVectorRow({

784+

db: this.db,

785+

tableName: VECTOR_TABLE,

786+

id,

787+

embedding,

788+

});

789+

}

790+

if (this.fts.enabled && this.fts.available) {

791+

this.db

792+

.prepare(

793+

`INSERT INTO ${FTS_TABLE} (text, id, path, source, model, start_line, end_line)\n` +

794+

` VALUES (?, ?, ?, ?, ?, ?, ?)`,

795+

)

796+

.run(chunk.text, id, entry.path, source, model, chunk.startLine, chunk.endLine);

797+

}

795798

}

796-

}

799+

this.upsertFileRecord(entry, source);

800+

});

797801

this.vectorDegradedWriteWarningShown = logMemoryVectorDegradedWrite({

798802

vectorEnabled: this.vector.enabled,

799803

vectorReady,

@@ -802,7 +806,6 @@ export abstract class MemoryManagerEmbeddingOps extends MemoryManagerSyncOps {

802806

loadError: this.vector.loadError,

803807

warn: (message) => log.warn(message),

804808

});

805-

this.upsertFileRecord(entry, source);

806809

}

807810808811

private async prepareIndexEntry(