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

推荐订阅源

Martin Fowler
Martin Fowler
Blog — PlanetScale
Blog — PlanetScale
Vercel News
Vercel News
L
LangChain Blog
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
博客园_首页
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
罗磊的独立博客
美团技术团队
V
V2EX

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): report qmd workspace cwd probe failures (#63...
sercada · 2026-05-23 · via Recent Commits to openclaw:main

@@ -1,4 +1,5 @@

11

import { spawn } from "node:child_process";

2+

import { statSync } from "node:fs";

23

import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "./windows-spawn.js";

3445

export type CliSpawnInvocation = {

@@ -8,11 +9,26 @@ export type CliSpawnInvocation = {

89

windowsHide?: boolean;

910

};

101111-

export type QmdBinaryAvailability = {

12-

available: boolean;

13-

error?: string;

12+

export type QmdBinaryUnavailableReason = "binary" | "workspace-cwd";

13+14+

export type QmdBinaryUnavailable = {

15+

available: false;

16+

/**

17+

* Optional for source compatibility with older plugin SDK callers that

18+

* returned only `{ available: false, error }`.

19+

*/

20+

reason?: QmdBinaryUnavailableReason;

21+

error: string;

1422

};

152324+

export type QmdBinaryAvailability = { available: true } | QmdBinaryUnavailable;

25+26+

export function resolveQmdBinaryUnavailableReason(

27+

result: QmdBinaryUnavailable,

28+

): QmdBinaryUnavailableReason {

29+

return result.reason ?? "binary";

30+

}

31+1632

export function resolveCliSpawnInvocation(params: {

1733

command: string;

1834

args: string[];

@@ -45,7 +61,13 @@ export async function checkQmdBinaryAvailability(params: {

4561

packageName: "qmd",

4662

});

4763

} catch (err) {

48-

return { available: false, error: formatQmdAvailabilityError(err) };

64+

return { available: false, reason: "binary", error: formatQmdAvailabilityError(err) };

65+

}

66+67+

const cwd = params.cwd ?? process.cwd();

68+

const cwdError = validateQmdProbeCwd(cwd);

69+

if (cwdError) {

70+

return cwdError;

4971

}

50725173

return await new Promise((resolve) => {

@@ -64,7 +86,7 @@ export async function checkQmdBinaryAvailability(params: {

64866587

const child = spawn(spawnInvocation.command, spawnInvocation.argv, {

6688

env: params.env,

67-

cwd: params.cwd ?? process.cwd(),

89+

cwd,

6890

shell: spawnInvocation.shell,

6991

windowsHide: spawnInvocation.windowsHide,

7092

stdio: "ignore",

@@ -73,12 +95,13 @@ export async function checkQmdBinaryAvailability(params: {

7395

child.kill("SIGKILL");

7496

finish({

7597

available: false,

98+

reason: "binary",

7699

error: `spawn ${params.command} timed out after ${params.timeoutMs ?? 2_000}ms`,

77100

});

78101

}, params.timeoutMs ?? 2_000);

7910280103

child.once("error", (err) => {

81-

finish({ available: false, error: formatQmdAvailabilityError(err) });

104+

finish({ available: false, reason: "binary", error: formatQmdAvailabilityError(err) });

82105

});

83106

child.once("spawn", () => {

84107

didSpawn = true;

@@ -94,6 +117,33 @@ export async function checkQmdBinaryAvailability(params: {

94117

});

95118

}

96119120+

function validateQmdProbeCwd(cwd: string): QmdBinaryAvailability | null {

121+

try {

122+

const stat = statSync(cwd);

123+

if (!stat.isDirectory()) {

124+

return {

125+

available: false,

126+

reason: "workspace-cwd",

127+

error: `workspace directory is not a directory: ${cwd}`,

128+

};

129+

}

130+

return null;

131+

} catch (err) {

132+

if (typeof err === "object" && err && "code" in err && err.code === "ENOENT") {

133+

return {

134+

available: false,

135+

reason: "workspace-cwd",

136+

error: `workspace directory missing: ${cwd}`,

137+

};

138+

}

139+

return {

140+

available: false,

141+

reason: "workspace-cwd",

142+

error: `workspace directory unavailable: ${cwd} (${formatQmdAvailabilityError(err)})`,

143+

};

144+

}

145+

}

146+97147

export async function runCliCommand(params: {

98148

commandSummary: string;

99149

spawnInvocation: CliSpawnInvocation;