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

推荐订阅源

I
InfoQ
S
SegmentFault 最新的问题
N
Netflix TechBlog - Medium
B
Blog
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 聂微东
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
V2EX
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
大猫的无限游戏
大猫的无限游戏
U
Unit 42
J
Java Code Geeks
IT之家
IT之家
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC

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): preserve Windows QMD command paths (#95274) ...
ly85206559 · 2026-06-23 · via Recent Commits to openclaw:main

File tree

  • packages/memory-host-sdk/src/host

Original file line numberDiff line numberDiff line change

@@ -166,6 +166,56 @@ describe("resolveMemoryBackendConfig", () => {

166166

expect(requireQmdConfig(resolved).command).toBe("/Applications/QMD Tools/qmd");

167167

});

168168
169+

it("preserves unquoted Windows absolute qmd command paths", () => {

170+

const command = String.raw`C:\Users\penny\AppData\Roaming\npm\node_modules\@tobilu\qmd\dist\cli\qmd.js`;

171+

const cfg = {

172+

agents: { defaults: { workspace: String.raw`C:\Users\penny\.openclaw\workspace` } },

173+

memory: {

174+

backend: "qmd",

175+

qmd: {

176+

command,

177+

},

178+

},

179+

} as OpenClawConfig;

180+
181+

const resolved = resolveMemoryBackendConfig({ cfg, agentId: "main" });

182+
183+

expect(requireQmdConfig(resolved).command).toBe(command);

184+

});

185+
186+

it("preserves Windows wrapper command paths before extra args", () => {

187+

const cfg = {

188+

agents: { defaults: { workspace: String.raw`C:\Users\penny\.openclaw\workspace` } },

189+

memory: {

190+

backend: "qmd",

191+

qmd: {

192+

command: String.raw`C:\Program Files\qmd\qmd.cmd --json`,

193+

},

194+

},

195+

} as OpenClawConfig;

196+
197+

const resolved = resolveMemoryBackendConfig({ cfg, agentId: "main" });

198+
199+

expect(requireQmdConfig(resolved).command).toBe(String.raw`C:\Program Files\qmd\qmd.cmd`);

200+

});

201+
202+

it("preserves unquoted UNC qmd command paths", () => {

203+

const command = String.raw`\\fileserver\tools\qmd\dist\cli\qmd.js`;

204+

const cfg = {

205+

agents: { defaults: { workspace: String.raw`C:\Users\penny\.openclaw\workspace` } },

206+

memory: {

207+

backend: "qmd",

208+

qmd: {

209+

command,

210+

},

211+

},

212+

} as OpenClawConfig;

213+
214+

const resolved = resolveMemoryBackendConfig({ cfg, agentId: "main" });

215+
216+

expect(requireQmdConfig(resolved).command).toBe(command);

217+

});

218+
169219

it("resolves custom paths relative to workspace", () => {

170220

const cfg = {

171221

agents: {

Original file line numberDiff line numberDiff line change

@@ -29,6 +29,34 @@ function escapeQmdExactFilePattern(fileName: string): string {

2929

return fileName.replace(/[\\*?[\]{}()!+@]/g, "\\$&");

3030

}

3131
32+

const WINDOWS_COMMAND_EXTENSION_RE =

33+

/^((?:[A-Za-z]:[\\/]|\\\\[^\\/]+[\\/][^\\/]+[\\/]).*?\.(?:bat|cmd|cjs|exe|js|mjs|ps1))(?:\s+|$)/i;

34+
35+

function resolveQmdCommand(rawCommand: string): string {

36+

const trimmedCommand = rawCommand.trim();

37+

const windowsCommand = resolveWindowsAbsoluteCommand(trimmedCommand);

38+

if (windowsCommand) {

39+

return windowsCommand;

40+

}

41+
42+

const parsedCommand = splitShellArgs(trimmedCommand);

43+

return parsedCommand?.[0] || trimmedCommand.split(/\s+/)[0] || "qmd";

44+

}

45+
46+

function resolveWindowsAbsoluteCommand(rawCommand: string): string | undefined {

47+

if (!path.win32.isAbsolute(rawCommand)) {

48+

return undefined;

49+

}

50+
51+

const extensionMatch = WINDOWS_COMMAND_EXTENSION_RE.exec(rawCommand);

52+

if (extensionMatch) {

53+

return extensionMatch[1];

54+

}

55+
56+

const firstWhitespace = rawCommand.search(/\s/);

57+

return firstWhitespace === -1 ? rawCommand : rawCommand.slice(0, firstWhitespace);

58+

}

59+
3260

export type ResolvedMemoryBackendConfig = {

3361

backend: MemoryBackend;

3462

citations: MemoryCitationsMode;

@@ -439,8 +467,7 @@ export function resolveMemoryBackendConfig(params: {

439467

];

440468
441469

const rawCommand = qmdCfg?.command?.trim() || "qmd";

442-

const parsedCommand = splitShellArgs(rawCommand);

443-

const command = parsedCommand?.[0] || rawCommand.split(/\s+/)[0] || "qmd";

470+

const command = resolveQmdCommand(rawCommand);

444471

const resolved: ResolvedQmdConfig = {

445472

command,

446473

mcporter: resolveMcporterConfig(qmdCfg?.mcporter),