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

推荐订阅源

D
Docker
小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
博客园 - 聂微东
S
SegmentFault 最新的问题
量子位
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页

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): safely refresh qmd index during collect...
openclaw-clo · 2026-06-15 · via Recent Commits to openclaw:main

@@ -285,6 +285,10 @@ describe("QmdMemoryManager", () => {

285285

throw new Error(`expected missing path ${targetPath}`);

286286

}

287287288+

function qmdIndexConfigPath(selectedAgentId = agentId): string {

289+

return path.join(stateDir, "agents", selectedAgentId, "qmd", "xdg-config", "qmd", "index.yml");

290+

}

291+288292

async function createManager(params?: {

289293

mode?: "full" | "status" | "cli";

290294

cfg?: OpenClawConfig;

@@ -1966,6 +1970,121 @@ describe("QmdMemoryManager", () => {

19661970

await manager.close();

19671971

});

196819721973+

it("refreshes qmd index config with quoted collection values during update repair", async () => {

1974+

const notesDir = path.join(workspaceDir, "Notes #1: blue");

1975+

await fs.mkdir(notesDir, { recursive: true });

1976+

cfg = {

1977+

...cfg,

1978+

memory: {

1979+

backend: "qmd",

1980+

qmd: {

1981+

includeDefaultMemory: false,

1982+

update: { interval: "0s", debounceMs: 0, onBoot: false },

1983+

paths: [{ path: notesDir, pattern: "**/* #tag: [draft].md", name: "notes" }],

1984+

},

1985+

},

1986+

} as OpenClawConfig;

1987+1988+

let updateCalls = 0;

1989+

spawnMock.mockImplementation((_cmd: string, args: string[]) => {

1990+

if (args[0] === "update") {

1991+

updateCalls += 1;

1992+

const child = createMockChild({ autoClose: false });

1993+

if (updateCalls === 1) {

1994+

emitAndClose(

1995+

child,

1996+

"stderr",

1997+

"SQLiteError: UNIQUE constraint failed: documents.collection, documents.path",

1998+

1,

1999+

);

2000+

return child;

2001+

}

2002+

queueMicrotask(() => {

2003+

child.closeWith(0);

2004+

});

2005+

return child;

2006+

}

2007+

return createMockChild();

2008+

});

2009+2010+

const { manager } = await createManager({ mode: "status" });

2011+

await expect(manager.sync({ reason: "manual" })).resolves.toBeUndefined();

2012+2013+

const indexConfig = await fs.readFile(qmdIndexConfigPath(), "utf8");

2014+

expect(indexConfig).toContain(' "notes-main":');

2015+

expect(indexConfig).toContain(` path: ${JSON.stringify(notesDir)}`);

2016+

expect(indexConfig).toContain(' pattern: "**/* #tag: [draft].md"');

2017+

expect(updateCalls).toBe(2);

2018+2019+

await manager.close();

2020+

});

2021+2022+

it("forces repair remove/add even when managed collections are still listed", async () => {

2023+

cfg = {

2024+

...cfg,

2025+

memory: {

2026+

backend: "qmd",

2027+

qmd: {

2028+

includeDefaultMemory: true,

2029+

update: { interval: "0s", debounceMs: 0, onBoot: false },

2030+

paths: [],

2031+

},

2032+

},

2033+

} as OpenClawConfig;

2034+2035+

let updateCalls = 0;

2036+

spawnMock.mockImplementation((_cmd: string, args: string[]) => {

2037+

if (args[0] === "collection" && args[1] === "list") {

2038+

const child = createMockChild({ autoClose: false });

2039+

emitAndClose(

2040+

child,

2041+

"stdout",

2042+

JSON.stringify([

2043+

{ name: "memory-root-main", path: workspaceDir, mask: "MEMORY.md" },

2044+

{ name: "memory-dir-main", path: path.join(workspaceDir, "memory"), mask: "**/*.md" },

2045+

]),

2046+

);

2047+

return child;

2048+

}

2049+

if (args[0] === "update") {

2050+

updateCalls += 1;

2051+

const child = createMockChild({ autoClose: false });

2052+

if (updateCalls === 1) {

2053+

emitAndClose(

2054+

child,

2055+

"stderr",

2056+

"SQLiteError: UNIQUE constraint failed: documents.collection, documents.path",

2057+

1,

2058+

);

2059+

return child;

2060+

}

2061+

queueMicrotask(() => {

2062+

child.closeWith(0);

2063+

});

2064+

return child;

2065+

}

2066+

return createMockChild();

2067+

});

2068+2069+

const { manager } = await createManager({ mode: "full" });

2070+

await expect(manager.sync({ reason: "manual" })).resolves.toBeUndefined();

2071+2072+

const removeCalls = spawnMock.mock.calls

2073+

.map((call: unknown[]) => call[1] as string[])

2074+

.filter((args: string[]) => args[0] === "collection" && args[1] === "remove")

2075+

.map((args) => args[2]);

2076+

const addCalls = spawnMock.mock.calls

2077+

.map((call: unknown[]) => call[1] as string[])

2078+

.filter((args: string[]) => args[0] === "collection" && args[1] === "add")

2079+

.map((args) => args[args.indexOf("--name") + 1]);

2080+2081+

expect(updateCalls).toBe(2);

2082+

expect(removeCalls).toEqual(["memory-root-main", "memory-dir-main"]);

2083+

expect(addCalls).toEqual(["memory-root-main", "memory-dir-main"]);

2084+2085+

await manager.close();

2086+

});

2087+19692088

it("does not rebuild collections for unrelated unique constraint failures", async () => {

19702089

cfg = {

19712090

...cfg,