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

推荐订阅源

F
Fortinet All Blogs
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
WordPress大学
WordPress大学
Jina AI
Jina AI
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
博客园 - Franky
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
雷峰网
雷峰网
小众软件
小众软件
H
Hackread – Cybersecurity News, Data Breaches, AI and More

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): bound npm onboard status artifacts · opencl...
vincentkoc · 2026-06-16 · via Recent Commits to openclaw:main

@@ -7,12 +7,52 @@ import {

77

assertOpenAiRequestLogUsed,

88

} from "../agent-turn-output.mjs";

99

import { assertOpenAiEnvAuthProfileStore } from "../auth-profile-store-assertions.mjs";

10+

import { readPositiveIntEnv } from "../env-limits.mjs";

1011

import { applyMockOpenAiModelConfig } from "../fixtures/mock-openai-config.mjs";

12+

import { readTextFileTail } from "../text-file-utils.mjs";

11131214

const command = process.argv[2];

13-

const readJson = (file) => JSON.parse(fs.readFileSync(file, "utf8"));

15+

const ERROR_DETAIL_TAIL_BYTES = 16 * 1024;

16+

const JSON_ARTIFACT_MAX_BYTES = readPositiveIntEnv(

17+

"OPENCLAW_NPM_ONBOARD_JSON_ARTIFACT_MAX_BYTES",

18+

1024 * 1024,

19+

);

20+

const STATUS_TEXT_MAX_BYTES = readPositiveIntEnv(

21+

"OPENCLAW_NPM_ONBOARD_STATUS_TEXT_MAX_BYTES",

22+

1024 * 1024,

23+

);

1424

const ansiEscapePattern = new RegExp(String.raw`\u001b\[[0-?]*[ -/]*[@-~]`, "g");

152526+

function readTextFileBounded(file, label, maxBytes) {

27+

const stat = fs.statSync(file);

28+

if (!stat.isFile()) {

29+

throw new Error(`${label} is not a file: ${file}`);

30+

}

31+

if (stat.size > maxBytes) {

32+

throw new Error(

33+

`${label} exceeded ${maxBytes} bytes: ${file} (${stat.size} bytes). Tail: ${readTextFileTail(

34+

file,

35+

ERROR_DETAIL_TAIL_BYTES,

36+

)}`,

37+

);

38+

}

39+

const text = fs.readFileSync(file, "utf8");

40+

const bytes = Buffer.byteLength(text, "utf8");

41+

if (bytes > maxBytes) {

42+

throw new Error(

43+

`${label} exceeded ${maxBytes} bytes: ${file} (${bytes} bytes). Tail: ${readTextFileTail(

44+

file,

45+

ERROR_DETAIL_TAIL_BYTES,

46+

)}`,

47+

);

48+

}

49+

return text;

50+

}

51+52+

function readJson(file) {

53+

return JSON.parse(readTextFileBounded(file, "JSON artifact", JSON_ARTIFACT_MAX_BYTES));

54+

}

55+1656

function stripAnsi(text) {

1757

return text.replace(ansiEscapePattern, "");

1858

}

@@ -198,6 +238,12 @@ function assertStatusSurfaces() {

198238

const channelsStatusPath = process.argv[4];

199239

const statusTextPath = process.argv[5];

200240

const channelsStatus = readJson(channelsStatusPath);

241+

const statusText = readTextFileBounded(

242+

statusTextPath,

243+

"plain status output",

244+

STATUS_TEXT_MAX_BYTES,

245+

);

246+

const statusTail = readTextFileTail(statusTextPath, ERROR_DETAIL_TAIL_BYTES);

201247

const configuredChannels = Array.isArray(channelsStatus.configuredChannels)

202248

? channelsStatus.configuredChannels

203249

: [];

@@ -206,17 +252,20 @@ function assertStatusSurfaces() {

206252

`channels status did not list configured channel ${channel}. Payload: ${JSON.stringify(channelsStatus)}`,

207253

);

208254

}

209-

const statusText = fs.readFileSync(statusTextPath, "utf8");

210255

if (!/channels/i.test(statusText)) {

211-

throw new Error(`plain status output did not render a Channels section. Output: ${statusText}`);

256+

throw new Error(

257+

`plain status output did not render a Channels section. Output tail: ${statusTail}`,

258+

);

212259

}

213260

const channelsSection = extractStatusSection(statusText, "channels");

214261

if (!channelsSection) {

215-

throw new Error(`plain status output did not render a Channels section. Output: ${statusText}`);

262+

throw new Error(

263+

`plain status output did not render a Channels section. Output tail: ${statusTail}`,

264+

);

216265

}

217266

if (!channelsSection.toLowerCase().includes(channel.toLowerCase())) {

218267

throw new Error(

219-

`plain status output did not mention ${channel} in the Channels section. Output: ${statusText}`,

268+

`plain status output did not mention ${channel} in the Channels section. Output tail: ${statusTail}`,

220269

);

221270

}

222271

}