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

推荐订阅源

N
Netflix TechBlog - Medium
J
Java Code Geeks
爱范儿
爱范儿
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog RSS Feed
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
The GitHub Blog
The GitHub Blog
I
InfoQ
月光博客
月光博客
博客园 - 聂微东
博客园 - Franky
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog
罗磊的独立博客
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(build): allow tsdown heap override · openclaw/opencla...
tayoun · 2026-06-22 · via Recent Commits to openclaw:main

@@ -54,7 +54,9 @@ function isProcessAlive(pid: number): boolean {

5454

}

55555656

async function sleep(ms: number): Promise<void> {

57-

await new Promise((resolve) => setTimeout(resolve, ms));

57+

await new Promise((resolve) => {

58+

setTimeout(resolve, ms);

59+

});

5860

}

59616062

async function waitForFile(filePath: string, timeoutMs: number): Promise<void> {

@@ -247,6 +249,56 @@ describe("resolveTsdownBuildInvocation", () => {

247249

expect(result.options.env.NODE_OPTIONS).toBe("--trace-warnings --max-old-space-size=6400");

248250

});

249251252+

it("honors OPENCLAW_TSDOWN_MAX_OLD_SPACE_MB over platform and memory defaults", () => {

253+

const result = resolveTsdownBuildInvocation({

254+

nodeExecPath: "/usr/bin/node",

255+

npmExecPath: "/tmp/pnpm.cjs",

256+

env: { OPENCLAW_TSDOWN_MAX_OLD_SPACE_MB: "3072" },

257+

cgroupMemoryLimitBytes: 7 * 1024 * 1024 * 1024,

258+

});

259+260+

expect(result.options.env.NODE_OPTIONS).toBe("--max-old-space-size=3072");

261+

});

262+263+

it("keeps memory detection when OPENCLAW_TSDOWN_MAX_OLD_SPACE_MB is blank", () => {

264+

const result = resolveTsdownBuildInvocation({

265+

nodeExecPath: "/usr/bin/node",

266+

npmExecPath: "/tmp/pnpm.cjs",

267+

env: { OPENCLAW_TSDOWN_MAX_OLD_SPACE_MB: " " },

268+

cgroupMemoryLimitBytes: 7 * 1024 * 1024 * 1024,

269+

});

270+271+

expect(result.options.env.NODE_OPTIONS).toBe("--max-old-space-size=6400");

272+

});

273+274+

it("uses OPENCLAW_TSDOWN_MAX_OLD_SPACE_MB to normalize inherited NODE_OPTIONS", () => {

275+

const result = resolveTsdownBuildInvocation({

276+

platform: "win32",

277+

nodeExecPath: "C:\\Program Files\\nodejs\\node.exe",

278+

npmExecPath: "C:\\repo\\pnpm.cjs",

279+

env: {

280+

NODE_OPTIONS: "--trace-warnings --max-old-space-size=12288",

281+

OPENCLAW_TSDOWN_MAX_OLD_SPACE_MB: "4096",

282+

},

283+

...NO_MEMORY_LIMIT,

284+

});

285+286+

expect(result.options.env.NODE_OPTIONS).toBe("--trace-warnings --max-old-space-size=4096");

287+

});

288+289+

it("rejects malformed OPENCLAW_TSDOWN_MAX_OLD_SPACE_MB values", () => {

290+

for (const value of ["0", "-1", "1.5", "1e3", "4096mb", "9007199254740992"]) {

291+

expect(() =>

292+

resolveTsdownBuildInvocation({

293+

nodeExecPath: "/usr/bin/node",

294+

npmExecPath: "/tmp/pnpm.cjs",

295+

env: { OPENCLAW_TSDOWN_MAX_OLD_SPACE_MB: value },

296+

...NO_MEMORY_LIMIT,

297+

}),

298+

).toThrow("OPENCLAW_TSDOWN_MAX_OLD_SPACE_MB must be");

299+

}

300+

});

301+250302

it("falls back to proc meminfo when the cgroup memory limit is unbounded", () => {

251303

const fsMock = {

252304

readFileSync: vi.fn((filePath: string) => {

@@ -727,7 +779,7 @@ describe("runTsdownBuildInvocation", () => {

727779

const rootDir = createTempDir("openclaw-tsdown-timeout-");

728780

const childPidPath = path.join(rootDir, "child.pid");

729781

const timeoutMs = 1_000;

730-

let childPid = 0;

782+

let childPid: number | undefined;

731783

const childScript = "process.on('SIGTERM', () => {}); setInterval(() => {}, 1000);";

732784

const parentScript = [

733785

"const { spawn } = require('node:child_process');",

@@ -769,7 +821,7 @@ describe("runTsdownBuildInvocation", () => {

769821

expect(result.timedOut).toBe(true);

770822

await waitForDead(childPid, 2_000);

771823

} finally {

772-

if (childPid && isProcessAlive(childPid)) {

824+

if (childPid !== undefined && isProcessAlive(childPid)) {

773825

process.kill(childPid, "SIGKILL");

774826

}

775827

}