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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
爱范儿
爱范儿
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
博客园_首页
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
V
V2EX
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队

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): salvage qmd search JSON after nonzero exit (...
osolmaz · 2026-05-27 · via Recent Commits to openclaw:main

@@ -1829,6 +1829,137 @@ describe("QmdMemoryManager", () => {

18291829

await manager.close();

18301830

});

183118311832+

it("uses valid qmd query JSON captured before a non-zero exit", async () => {

1833+

cfg = {

1834+

...cfg,

1835+

memory: {

1836+

backend: "qmd",

1837+

qmd: {

1838+

includeDefaultMemory: false,

1839+

searchMode: "query",

1840+

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

1841+

paths: [{ path: workspaceDir, pattern: "**/*.md", name: "workspace" }],

1842+

},

1843+

},

1844+

} as OpenClawConfig;

1845+1846+

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

1847+

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

1848+

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

1849+

queueMicrotask(() => {

1850+

child.stdout.emit("data", "initializing qmd reranker\n");

1851+

child.stdout.emit(

1852+

"data",

1853+

JSON.stringify(

1854+

[

1855+

{

1856+

file: "qmd://workspace-main/notes/welcome.md",

1857+

score: 0.93,

1858+

snippet: "@@ -7,1\nrouter glacier backup",

1859+

},

1860+

],

1861+

null,

1862+

2,

1863+

),

1864+

);

1865+

child.stderr.emit("data", "ggml-metal-device.m:612 assertion failed");

1866+

child.closeWith(134);

1867+

});

1868+

return child;

1869+

}

1870+

return createMockChild();

1871+

});

1872+1873+

const { manager } = await createManager();

1874+1875+

await expect(

1876+

manager.search("router glacier backup", { sessionKey: "agent:main:slack:dm:u123" }),

1877+

).resolves.toEqual([

1878+

{

1879+

path: "notes/welcome.md",

1880+

startLine: 7,

1881+

endLine: 7,

1882+

score: 0.93,

1883+

snippet: "@@ -7,1\nrouter glacier backup",

1884+

source: "memory",

1885+

},

1886+

]);

1887+

expectMockMessageContains(

1888+

logWarnMock,

1889+

"qmd query exited non-zero after producing valid JSON; using captured search results (code 134)",

1890+

);

1891+

await manager.close();

1892+

});

1893+1894+

it("keeps invalid qmd query stdout failed after a non-zero exit", async () => {

1895+

cfg = {

1896+

...cfg,

1897+

memory: {

1898+

backend: "qmd",

1899+

qmd: {

1900+

includeDefaultMemory: false,

1901+

searchMode: "query",

1902+

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

1903+

paths: [{ path: workspaceDir, pattern: "**/*.md", name: "workspace" }],

1904+

},

1905+

},

1906+

} as OpenClawConfig;

1907+1908+

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

1909+

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

1910+

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

1911+

emitAndClose(child, "stdout", "not json", 134);

1912+

return child;

1913+

}

1914+

return createMockChild();

1915+

});

1916+1917+

const { manager } = await createManager();

1918+1919+

await expect(

1920+

manager.search("router glacier backup", { sessionKey: "agent:main:slack:dm:u123" }),

1921+

).rejects.toThrow(/qmd query router glacier backup .* failed \(code 134\): not json/);

1922+

await manager.close();

1923+

});

1924+1925+

it("does not use qmd query JSON from a non-crash search failure", async () => {

1926+

cfg = {

1927+

...cfg,

1928+

memory: {

1929+

backend: "qmd",

1930+

qmd: {

1931+

includeDefaultMemory: false,

1932+

searchMode: "query",

1933+

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

1934+

paths: [{ path: workspaceDir, pattern: "**/*.md", name: "workspace" }],

1935+

},

1936+

},

1937+

} as OpenClawConfig;

1938+1939+

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

1940+

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

1941+

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

1942+

queueMicrotask(() => {

1943+

child.stdout.emit("data", "[]");

1944+

child.stderr.emit("data", "SQLITE_BUSY: database is locked");

1945+

child.closeWith(2);

1946+

});

1947+

return child;

1948+

}

1949+

return createMockChild();

1950+

});

1951+1952+

const { manager } = await createManager();

1953+1954+

await expect(

1955+

manager.search("router glacier backup", { sessionKey: "agent:main:slack:dm:u123" }),

1956+

).rejects.toThrow(/SQLITE_BUSY: database is locked/);

1957+

expect(logWarnMock).not.toHaveBeenCalledWith(

1958+

expect.stringContaining("using captured search results"),

1959+

);

1960+

await manager.close();

1961+

});

1962+18321963

it("repairs missing managed collections and retries search once", async () => {

18331964

cfg = {

18341965

...cfg,

@@ -1864,7 +1995,11 @@ describe("QmdMemoryManager", () => {

18641995

if (collection === "memory-root-main" && !missingCollectionSeen) {

18651996

missingCollectionSeen = true;

18661997

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

1867-

emitAndClose(child, "stderr", "Collection not found: memory-root-main", 1);

1998+

queueMicrotask(() => {

1999+

child.stdout.emit("data", "[]");

2000+

child.stderr.emit("data", "Collection not found: memory-root-main");

2001+

child.closeWith(1);

2002+

});

18682003

return child;

18692004

}

18702005

if (collection === "memory-root-main") {