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

推荐订阅源

F
Full Disclosure
Recorded Future
Recorded Future
T
Tenable Blog
S
Securelist
C
CERT Recently Published Vulnerability Notes
T
Threatpost
S
Schneier on Security
A
Arctic Wolf
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Register - Security
The Register - Security
Cisco Talos Blog
Cisco Talos Blog
AWS News Blog
AWS News Blog
K
Kaspersky official blog
T
True Tiger Recordings
T
Threat Research - Cisco Blogs
V
Vulnerabilities – Threatpost
P
Palo Alto Networks Blog
T
The Exploit Database - CXSecurity.com
小众软件
小众软件
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tor Project blog
Spread Privacy
Spread Privacy
Malwarebytes
Malwarebytes
P
Proofpoint News Feed
F
Fox-IT International blog
F
Fortinet All Blogs
P
Privacy & Cybersecurity Law Blog
G
GRAHAM CLULEY
量子位
Latest news
Latest news
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
Project Zero
Project Zero
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
I
Intezer
博客园_首页
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Darknet – Hacking Tools, Hacker News & Cyber Security

Recent Commits to openclaw:main

fix(filefetch): wrap fetched text as external content (#87062) · openclaw/openclaw@42b8898 fix(ci): satisfy script oxlint sort rule · openclaw/openclaw@ffe1213 ci: tolerate gateway status help probe hangs fix(memory-core): close providers created during shutdown · openclaw/openclaw@e982302 fix(gateway): bound e2e HTTP helper responses · openclaw/openclaw@6509da7 fix(agents): honor per-agent thinking defaults for ingress runs (#86689) · openclaw/openclaw@bba4298 perf: trim gateway runtime hotspots · openclaw/openclaw@2035f38 fix(sessions): avoid parsing object cache writes · openclaw/openclaw@f6599ed test(cli): allow mac startup memory overhead · openclaw/openclaw@978cb6a fix(crabbox): show broker url in auth guard fix(crabbox): require broker auth for aws proof · openclaw/openclaw@7c432d2 fix(docker): bound kitchen sink plugin commands · openclaw/openclaw@d353dc1 test: skip claude resume live proof without cli · openclaw/openclaw@049d6c9 fix(agents): force SIGKILL for stuck MCP stdio children (#86739) · openclaw/openclaw@71d24f9 fix(codex): avoid false queued terminal idle timeout (#87096) · openclaw/openclaw@1dbd9a3 fix(gateway): fail hot cpu scenario checks · openclaw/openclaw@bfddd45 fix(cron): preview no-deliver message targets · openclaw/openclaw@c9ca7fc perf: reduce gateway cpu churn · openclaw/openclaw@a43da0c fix(gateway): harden runtime smoke checks fix(docker): bound plugin sweep reads · openclaw/openclaw@86ff2cf test: make docker package timeout proof robust · openclaw/openclaw@94cd364 fix(anthropic): pass system prompt on resumed claude-cli sessions · openclaw/openclaw@84e6282 fix(skills): sync plugin skills to sandbox workspaces · openclaw/openclaw@d8f6d65 docs: show PR LOC in maintainer reviews · openclaw/openclaw@8b8e088 fix(codex): raise dynamic tool timeout · openclaw/openclaw@0f18d52 fix(cli): handle Bun launcher module misses · openclaw/openclaw@a1934e9 fix(docker): bound plugin sweep commands · openclaw/openclaw@e46b92c docs: improve PR blame provenance · openclaw/openclaw@ebfcddb fix: scrub serialized tool-call text from replies (#86924) · openclaw/openclaw@ee655f4 test: fix CI type checks · openclaw/openclaw@eac918d fix(e2e): resolve mac update smoke commands from PATH · openclaw/openclaw@b654117 test(docs): avoid URL default stringification · openclaw/openclaw@61fa2b2 test: speed up plugin runtime tests · openclaw/openclaw@9f7584c fix(docs): use Cloudflare docs search API · openclaw/openclaw@69d84d7 test: speed up run-node infra tests · openclaw/openclaw@7e913c0 fix(docker): bound e2e image builds · openclaw/openclaw@6ef0cbb fix(agents): unwrap standalone message tool JSON (#86626) · openclaw/openclaw@030861e fix(slack): fast-path wildcard open DM policy · openclaw/openclaw@9cd1d27 ci: retry corepack pnpm activation · openclaw/openclaw@d122839 test: bound gateway live model discovery · openclaw/openclaw@dc1e6fb test: speed up plugin install suites · openclaw/openclaw@75fc0bc fix(irc): use channel routes for group inbound targets · openclaw/openclaw@bf8be79 Preserve xAI usage limit errors in local TUI (#86614) · openclaw/openclaw@532494b fix: filter claude autoreview streaming · openclaw/openclaw@fa384d4 fix(cli-runner): scale Claude CLI reseed history automatically · openclaw/openclaw@474b1e0 test: speed up infra test hotspots · openclaw/openclaw@8592352 fix(e2e): keep mac smoke commands bounded without timeout · openclaw/openclaw@3e70144 fix(live): classify Z.ai plan denials as billing drift · openclaw/openclaw@693f06d fix(config): render transform-backed config schema inputs (#67328) · openclaw/openclaw@678a0ee perf: speed up test hotspots · openclaw/openclaw@980d73d feat: stream autoreview progress · openclaw/openclaw@322ceb3 test: improve full-suite failure summaries · openclaw/openclaw@8f1fb67 fix(e2e): require bounded helper timeouts · openclaw/openclaw@0028c2f fix(ui): eliminate double scrollbar on Logs view · openclaw/openclaw@068d88c test: speed up hot test fixtures · openclaw/openclaw@0f608bc fix(auto-reply): suppress repeated silent tokens (#86848) · openclaw/openclaw@8ec2b2d fix(commands): preserve async skill commands · openclaw/openclaw@1313e15 fix(docker): bound telegram npm installs · openclaw/openclaw@130464e fix(mac): use corepack pnpm for app packaging · openclaw/openclaw@728b61a fix: mark ios watch app as watchkit app · openclaw/openclaw@1600bcd docs: explain bundled plugin npm override · openclaw/openclaw@40fa750 fix: keep bundled OpenClaw plugins image-owned · openclaw/openclaw@771675e test: fix bundled install mock typing · openclaw/openclaw@669bfdd fix: preserve whatsapp inbound batch order · openclaw/openclaw@84a33c7 perf: cache npm globalconfig lookups · openclaw/openclaw@3f524a6 fix(daemon): ignore recursive Windows gateway wrapper · openclaw/openclaw@126a336 fix(docker): bound live setup commands · openclaw/openclaw@eb15c44 fix: restore ios build stability · openclaw/openclaw@1daef79 feat(plugin-sdk): add reaction approval helpers (#86735) · openclaw/openclaw@7d6b7f4 test(auto-reply): type manifest catalog harness mock · openclaw/openclaw@4f83cd6 fix(docker): bound live docker runs · openclaw/openclaw@96307ca test(auto-reply): mock manifest model catalog in trigger harness · openclaw/openclaw@989d449 fix(crabbox): scope env-wrapped macOS bootstrap · openclaw/openclaw@2f7bfdb fix(gateway): reject RPCs from invalidated device-token clients durin… · openclaw/openclaw@1e1cf14 fix(channel): handle plugin channel markdown fallback · openclaw/openclaw@6158742 fix(docker): require bounded e2e docker commands · openclaw/openclaw@3736d7b fix(codex): share native hook relay registry (#73950) · openclaw/openclaw@6729dea fix(release): stabilize plugin prerelease tests · openclaw/openclaw@5a684c4 fix(diagnostics): flush OTel trace batches · openclaw/openclaw@c4b9f54 fix(memory): reject invalid CLI numeric options · openclaw/openclaw@d569e41 fix(codex): bound app-server timeout fallout · openclaw/openclaw@5a7d5c6 fix(agents): keep model browse normalization bounded · openclaw/openclaw@9fc71e9 fix: stabilize media-related tests · openclaw/openclaw@a818556 fix(ci): preserve docker pull retry failures · openclaw/openclaw@be2213e fix(build): stabilize shrinkwrap generation · openclaw/openclaw@538b537 fix(ui): ignore stale running session rows · openclaw/openclaw@1705189 ci: support windows node download fallback · openclaw/openclaw@bb48fcf test(agents): pin native anthropic replay policy · openclaw/openclaw@acd3ce0 fix(status): surface systemd gateway hygiene (#86976) · openclaw/openclaw@0a085bf fix(ui): show failed tool results as errors (#85786) ci: allow Windows Node 22 patch range · openclaw/openclaw@ce4db4f ci: enforce Node 22 floor in setup helper · openclaw/openclaw@1d972af Fix status JSON plugin scan (#87001) · openclaw/openclaw@f3e6158 fix(telegram): preserve command slots for aliases (#85270) · openclaw/openclaw@77505da fix(agents): handle deferred maintenance drain · openclaw/openclaw@94fb547 test: keep legacy tool-result error proof ci: fix post-merge Rastermill checks · openclaw/openclaw@b546998 fix(agents): mark repaired legacy tool results errored · openclaw/openclaw@8523d32 docs(changelog): note rastermill exif fix docs(changelog): regroup 2026.5.26 release notes · openclaw/openclaw@a6973ab
fix(cli): bound startup memory probes · openclaw/openclaw@2b5fba1
vincentkoc · 2026-05-27 · via Recent Commits to openclaw:main

@@ -1,24 +1,27 @@

11

#!/usr/bin/env node

223-

import { spawnSync } from "node:child_process";

3+

import { spawnSync as defaultSpawnSync } from "node:child_process";

44

import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";

55

import os from "node:os";

66

import path from "node:path";

7-8-

const isLinux = process.platform === "linux";

9-

const isMac = process.platform === "darwin";

10-11-

if (!isLinux && !isMac) {

12-

console.log(`[startup-memory] Skipping on unsupported platform: ${process.platform}`);

13-

process.exit(0);

14-

}

7+

import { pathToFileURL } from "node:url";

158169

const repoRoot = process.cwd();

1710

const tmpDir = process.env.TMPDIR || process.env.TEMP || process.env.TMP || os.tmpdir();

1811

const MAX_RSS_MARKER = "__OPENCLAW_MAX_RSS_KB__=";

12+

const DEFAULT_COMMAND_TIMEOUT_MS = 60_000;

13+

const COMMAND_TIMEOUT_MS = readPositiveIntEnv(

14+

"OPENCLAW_STARTUP_MEMORY_TIMEOUT_MS",

15+

DEFAULT_COMMAND_TIMEOUT_MS,

16+

);

1917

let tmpHome = null;

2018

let rssHookPath = null;

211920+

function readPositiveIntEnv(name, fallback) {

21+

const value = Number(process.env[name] ?? "");

22+

return Number.isInteger(value) && value > 0 ? value : fallback;

23+

}

24+2225

function parseArgs(argv) {

2326

const options = {

2427

jsonPath:

@@ -171,16 +174,20 @@ function buildBenchEnv() {

171174

return env;

172175

}

173176174-

function runCase(testCase) {

177+

function runCase(testCase, params = {}) {

175178

if (!rssHookPath) {

176179

throw new Error("RSS hook path is not initialized");

177180

}

178181

const env = buildBenchEnv();

179-

const result = spawnSync(process.execPath, ["--import", rssHookPath, ...testCase.args], {

182+

const spawn = params.spawnSync ?? defaultSpawnSync;

183+

const timeoutMs = params.timeoutMs ?? COMMAND_TIMEOUT_MS;

184+

const result = spawn(process.execPath, ["--import", rssHookPath, ...testCase.args], {

180185

cwd: repoRoot,

181186

env,

182187

encoding: "utf8",

183188

maxBuffer: 20 * 1024 * 1024,

189+

timeout: timeoutMs,

190+

killSignal: "SIGKILL",

184191

});

185192

const stderr = result.stderr ?? "";

186193

const maxRssMb = parseMaxRssMb(stderr);

@@ -193,12 +200,24 @@ function runCase(testCase) {

193200

maxRssMb,

194201

status: "pass",

195202

exitCode: result.status,

203+

signal: result.signal ?? null,

196204

error: null,

197205

};

198206207+

if (result.error) {

208+

const timedOut = result.error.code === "ETIMEDOUT";

209+

report.status = "fail";

210+

report.error = timedOut

211+

? `${testCase.label} timed out after ${timeoutMs}ms`

212+

: `${testCase.label} failed to start: ${result.error.message}`;

213+

return Object.assign(report, {

214+

failureMessage: formatFailure(testCase, report.error, stderr.trim() || result.stdout || ""),

215+

});

216+

}

199217

if (result.status !== 0) {

200218

report.status = "fail";

201-

report.error = `${testCase.label} exited with ${String(result.status)}`;

219+

const exitDetail = result.status ?? result.signal ?? "unknown";

220+

report.error = `${testCase.label} exited with ${String(exitDetail)}`;

202221

return Object.assign(report, {

203222

failureMessage: formatFailure(testCase, report.error, stderr.trim() || result.stdout || ""),

204223

});

@@ -271,33 +290,59 @@ function writeReport(options, results) {

271290

writeFileSync(options.summaryPath, `${lines.join("\n")}\n`, "utf8");

272291

}

273292274-

const options = parseArgs(process.argv.slice(2));

275-

tmpHome = mkdtempSync(path.join(os.tmpdir(), "openclaw-startup-memory-"));

276-

rssHookPath = path.join(tmpHome, "measure-rss.mjs");

277-

writeFileSync(

278-

rssHookPath,

279-

[

280-

"process.on('exit', () => {",

281-

" const usage = typeof process.resourceUsage === 'function' ? process.resourceUsage() : null;",

282-

` if (usage && typeof usage.maxRSS === 'number') console.error('${MAX_RSS_MARKER}' + String(usage.maxRSS));`,

283-

"});",

284-

"",

285-

].join("\n"),

286-

"utf8",

287-

);

288-

const results = [];

289-

try {

290-

for (const testCase of cases) {

291-

results.push(runCase(testCase));

293+

function runStartupMemoryCheck(argv = process.argv.slice(2), params = {}) {

294+

const platform = params.platform ?? process.platform;

295+

if (platform !== "linux" && platform !== "darwin") {

296+

console.log(`[startup-memory] Skipping on unsupported platform: ${platform}`);

297+

return { skipped: true, results: [] };

292298

}

293-

} finally {

294-

writeReport(options, results);

295-

if (tmpHome) {

296-

rmSync(tmpHome, { recursive: true, force: true });

299+

const options = parseArgs(argv);

300+

tmpHome = mkdtempSync(path.join(os.tmpdir(), "openclaw-startup-memory-"));

301+

rssHookPath = path.join(tmpHome, "measure-rss.mjs");

302+

writeFileSync(

303+

rssHookPath,

304+

[

305+

"process.on('exit', () => {",

306+

" const usage = typeof process.resourceUsage === 'function' ? process.resourceUsage() : null;",

307+

` if (usage && typeof usage.maxRSS === 'number') console.error('${MAX_RSS_MARKER}' + String(usage.maxRSS));`,

308+

"});",

309+

"",

310+

].join("\n"),

311+

"utf8",

312+

);

313+

const results = [];

314+

try {

315+

for (const testCase of cases) {

316+

results.push(runCase(testCase, params));

317+

}

318+

} finally {

319+

writeReport(options, results);

320+

if (tmpHome) {

321+

rmSync(tmpHome, { recursive: true, force: true });

322+

tmpHome = null;

323+

rssHookPath = null;

324+

}

297325

}

326+327+

const failure = results.find((result) => result.status !== "pass");

328+

if (failure?.failureMessage) {

329+

throw new Error(failure.failureMessage);

330+

}

331+

return { skipped: false, results };

298332

}

299333300-

const failure = results.find((result) => result.status !== "pass");

301-

if (failure?.failureMessage) {

302-

throw new Error(failure.failureMessage);

334+

export const testing = {

335+

cases,

336+

parseArgs,

337+

runCase,

338+

runStartupMemoryCheck,

339+

};

340+341+

if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {

342+

try {

343+

runStartupMemoryCheck();

344+

} catch (error) {

345+

console.error(error instanceof Error ? error.stack : String(error));

346+

process.exitCode = 1;

347+

}

303348

}