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

推荐订阅源

G
Google Developers Blog
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Help Net Security
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
S
SegmentFault 最新的问题
The Cloudflare Blog
I
InfoQ
美团技术团队
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 司徒正美
L
LangChain Blog
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
Y
Y Combinator 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(scripts): avoid Windows shell argv warnings · opencla...
vincentkoc · 2026-05-24 · via Recent Commits to openclaw:main

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

11

import { spawn } from "node:child_process";

2+

import { buildCmdExeCommandLine } from "../windows-cmd-helpers.mjs";

2334

const FORWARDED_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];

45

const FORCE_KILL_DELAY_MS = 5_000;

@@ -48,6 +49,9 @@ function terminateManagedChild(child, signal = "SIGTERM") {

4849

* env?: NodeJS.ProcessEnv;

4950

* stdio?: import("node:child_process").StdioOptions;

5051

* shell?: boolean;

52+

* windowsVerbatimArguments?: boolean;

53+

* platform?: NodeJS.Platform;

54+

* comSpec?: string;

5155

* onReady?: (child: import("node:child_process").ChildProcess) => void;

5256

* }} options

5357

* @returns {Promise<number>}

@@ -59,15 +63,23 @@ export async function runManagedCommand({

5963

env,

6064

stdio = "inherit",

6165

shell = process.platform === "win32",

66+

windowsVerbatimArguments,

67+

platform = process.platform,

68+

comSpec,

6269

onReady,

6370

}) {

64-

const child = spawn(bin, args, {

71+

const spawnSpec = createManagedCommandSpawnSpec({

72+

bin,

73+

args,

6574

cwd,

6675

env,

6776

stdio,

6877

shell,

69-

detached: process.platform !== "win32",

78+

windowsVerbatimArguments,

79+

platform,

80+

comSpec,

7081

});

82+

const child = spawn(spawnSpec.command, spawnSpec.args, spawnSpec.options);

71837284

let receivedSignal = null;

7385

let forceKillTimer = null;

@@ -102,6 +114,91 @@ export async function runManagedCommand({

102114

}

103115

}

104116117+

/**

118+

* @param {{

119+

* bin: string;

120+

* args?: string[];

121+

* cwd?: string;

122+

* env?: NodeJS.ProcessEnv;

123+

* stdio?: import("node:child_process").StdioOptions;

124+

* shell?: boolean;

125+

* windowsVerbatimArguments?: boolean;

126+

* platform?: NodeJS.Platform;

127+

* comSpec?: string;

128+

* }} options

129+

*/

130+

export function createManagedCommandSpawnSpec({

131+

bin,

132+

args = [],

133+

cwd,

134+

env,

135+

stdio = "inherit",

136+

shell = process.platform === "win32",

137+

windowsVerbatimArguments,

138+

platform = process.platform,

139+

comSpec,

140+

}) {

141+

const invocation = createManagedCommandInvocation({

142+

bin,

143+

args,

144+

env,

145+

shell,

146+

windowsVerbatimArguments,

147+

platform,

148+

comSpec,

149+

});

150+151+

return {

152+

args: invocation.args,

153+

command: invocation.command,

154+

options: {

155+

cwd,

156+

env,

157+

stdio,

158+

shell: invocation.shell,

159+

detached: platform !== "win32",

160+

windowsVerbatimArguments: invocation.windowsVerbatimArguments,

161+

},

162+

};

163+

}

164+165+

/**

166+

* @param {{

167+

* bin: string;

168+

* args?: string[];

169+

* env?: NodeJS.ProcessEnv;

170+

* shell?: boolean;

171+

* windowsVerbatimArguments?: boolean;

172+

* platform?: NodeJS.Platform;

173+

* comSpec?: string;

174+

* }} options

175+

*/

176+

export function createManagedCommandInvocation({

177+

bin,

178+

args = [],

179+

env,

180+

shell = process.platform === "win32",

181+

windowsVerbatimArguments,

182+

platform = process.platform,

183+

comSpec,

184+

}) {

185+

if (platform === "win32" && shell && args.length > 0) {

186+

return {

187+

args: ["/d", "/s", "/c", buildCmdExeCommandLine(bin, args)],

188+

command: comSpec ?? env?.ComSpec ?? env?.COMSPEC ?? process.env.ComSpec ?? "cmd.exe",

189+

shell: false,

190+

windowsVerbatimArguments: true,

191+

};

192+

}

193+194+

return {

195+

args,

196+

command: bin,

197+

shell,

198+

windowsVerbatimArguments,

199+

};

200+

}

201+105202

function signalNumberFor(signal) {

106203

switch (signal) {

107204

case "SIGHUP":