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

推荐订阅源

V
Vulnerabilities – Threatpost
V
V2EX
GbyAI
GbyAI
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
Y
Y Combinator Blog
C
Check Point Blog
爱范儿
爱范儿
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
美团技术团队
雷峰网
雷峰网
IT之家
IT之家
WordPress大学
WordPress大学
V
Visual Studio Blog
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
N
News and Events Feed by Topic
罗磊的独立博客
S
SegmentFault 最新的问题
S
Security Affairs
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
H
Hacker News: Front Page
Google DeepMind News
Google DeepMind News
B
Blog
O
OpenAI News
C
Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
Hacker News: Ask HN
Hacker News: Ask HN
博客园_首页
人人都是产品经理
人人都是产品经理
C
Cybersecurity and Infrastructure Security Agency CISA
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Help Net Security
Help Net Security
月光博客
月光博客
J
Java Code Geeks
L
LangChain Blog
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Apple Machine Learning Research
Apple Machine Learning Research
T
The Exploit Database - CXSecurity.com
N
News and Events Feed by Topic
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & 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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix(e2e): bound bundled runtime log scans · openclaw/openclaw@694907d
vincentkoc · 2026-05-27 · via Recent Commits to openclaw:main

@@ -11,6 +11,10 @@ const OUTPUT_CAPTURE_CHARS = readPositiveInt(

1111

process.env.OPENCLAW_BUNDLED_PLUGIN_RUNTIME_OUTPUT_CHARS,

1212

1024 * 1024,

1313

);

14+

const LOG_SCAN_BYTES = readPositiveInt(

15+

process.env.OPENCLAW_BUNDLED_PLUGIN_RUNTIME_LOG_SCAN_BYTES,

16+

256 * 1024,

17+

);

1418

const WATCHDOG_MS = readPositiveInt(process.env.OPENCLAW_BUNDLED_PLUGIN_RUNTIME_WATCHDOG_MS, 1000);

1519

const READY_TIMEOUT_MS = readPositiveInt(

1620

process.env.OPENCLAW_BUNDLED_PLUGIN_RUNTIME_READY_MS,

@@ -29,6 +33,13 @@ const HTTP_PROBE_TIMEOUT_MS = readPositiveInt(

2933

process.env.OPENCLAW_BUNDLED_PLUGIN_RUNTIME_HTTP_MS,

3034

5000,

3135

);

36+

const GATEWAY_READY_LOG_NEEDLE = Buffer.from("[gateway] ready");

37+

const READY_OFFSET_LOG_NEEDLES = [

38+

GATEWAY_READY_LOG_NEEDLE,

39+

Buffer.from("listening on ws://"),

40+

Buffer.from("[gateway] http server listening"),

41+

];

42+

const FORBIDDEN_POST_READY_DEPS_WORK = [/\b(?:npm|pnpm|yarn|corepack) install\b/iu];

32433344

function readPositiveInt(raw, fallback) {

3445

const parsed = Number.parseInt(String(raw || ""), 10);

@@ -44,6 +55,132 @@ function writeJson(file, value) {

4455

fs.writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`);

4556

}

465758+

function readFileChunk(file, startOffset, maxBytes) {

59+

let stat;

60+

try {

61+

stat = fs.statSync(file);

62+

} catch {

63+

return { buffer: Buffer.alloc(0), startOffset: 0, size: 0 };

64+

}

65+

if (!stat.isFile() || stat.size <= 0) {

66+

return { buffer: Buffer.alloc(0), startOffset: 0, size: stat.size };

67+

}

68+69+

const safeMaxBytes = Math.max(1, Math.floor(Number(maxBytes) || LOG_SCAN_BYTES));

70+

const safeStartOffset = Math.min(Math.max(0, Math.floor(Number(startOffset) || 0)), stat.size);

71+

const bytesToRead = Math.min(safeMaxBytes, stat.size - safeStartOffset);

72+

if (bytesToRead <= 0) {

73+

return { buffer: Buffer.alloc(0), startOffset: safeStartOffset, size: stat.size };

74+

}

75+76+

const buffer = Buffer.alloc(bytesToRead);

77+

const fd = fs.openSync(file, "r");

78+

try {

79+

const bytesRead = fs.readSync(fd, buffer, 0, bytesToRead, safeStartOffset);

80+

return { buffer: buffer.subarray(0, bytesRead), startOffset: safeStartOffset, size: stat.size };

81+

} finally {

82+

fs.closeSync(fd);

83+

}

84+

}

85+86+

function readFileTailBuffer(file, maxBytes = LOG_SCAN_BYTES) {

87+

let stat;

88+

try {

89+

stat = fs.statSync(file);

90+

} catch {

91+

return { buffer: Buffer.alloc(0), startOffset: 0, size: 0 };

92+

}

93+

const safeMaxBytes = Math.max(1, Math.floor(Number(maxBytes) || LOG_SCAN_BYTES));

94+

const startOffset = Math.max(0, stat.size - safeMaxBytes);

95+

return readFileChunk(file, startOffset, safeMaxBytes);

96+

}

97+98+

export function readFileTail(file, maxBytes = LOG_SCAN_BYTES) {

99+

return readFileTailBuffer(file, maxBytes).buffer.toString("utf8");

100+

}

101+102+

function findFirstNeedleOffset(file, needles) {

103+

let stat;

104+

try {

105+

stat = fs.statSync(file);

106+

} catch {

107+

return 0;

108+

}

109+

if (!stat.isFile() || stat.size <= 0) {

110+

return 0;

111+

}

112+113+

const carryBytes = Math.max(0, ...needles.map((needle) => needle.length - 1));

114+

const chunk = Buffer.alloc(Math.min(LOG_SCAN_BYTES, stat.size));

115+

const fd = fs.openSync(file, "r");

116+

let carry = Buffer.alloc(0);

117+

let offset = 0;

118+

try {

119+

while (offset < stat.size) {

120+

const bytesToRead = Math.min(chunk.length, stat.size - offset);

121+

const bytesRead = fs.readSync(fd, chunk, 0, bytesToRead, offset);

122+

if (bytesRead <= 0) {

123+

break;

124+

}

125+

const view = chunk.subarray(0, bytesRead);

126+

const combined = carry.length > 0 ? Buffer.concat([carry, view]) : view;

127+

const combinedOffset = offset - carry.length;

128+

const indexes = needles

129+

.map((needle) => combined.indexOf(needle))

130+

.filter((index) => index >= 0);

131+

if (indexes.length > 0) {

132+

return combinedOffset + Math.min(...indexes);

133+

}

134+

carry = combined.subarray(Math.max(0, combined.length - carryBytes));

135+

offset += bytesRead;

136+

}

137+

} finally {

138+

fs.closeSync(fd);

139+

}

140+

return 0;

141+

}

142+143+

export function createReadyLogScanner(file) {

144+

const carryBytes = GATEWAY_READY_LOG_NEEDLE.length - 1;

145+

let carry = Buffer.alloc(0);

146+

let offset = 0;

147+

let seen = false;

148+149+

return () => {

150+

if (seen) {

151+

return true;

152+

}

153+

let stat;

154+

try {

155+

stat = fs.statSync(file);

156+

} catch {

157+

return false;

158+

}

159+

if (!stat.isFile() || stat.size <= 0) {

160+

return false;

161+

}

162+

if (stat.size < offset) {

163+

carry = Buffer.alloc(0);

164+

offset = 0;

165+

}

166+

while (offset < stat.size) {

167+

const { buffer } = readFileChunk(file, offset, LOG_SCAN_BYTES);

168+

if (buffer.length === 0) {

169+

break;

170+

}

171+

const combined = carry.length > 0 ? Buffer.concat([carry, buffer]) : buffer;

172+

const matched = combined.includes(GATEWAY_READY_LOG_NEEDLE);

173+

if (matched) {

174+

seen = true;

175+

return true;

176+

}

177+

carry = combined.subarray(Math.max(0, combined.length - carryBytes));

178+

offset += buffer.length;

179+

}

180+

return false;

181+

};

182+

}

183+47184

function manifestPath(pluginDir, pluginRoot) {

48185

const candidates = [

49186

...(isNonEmptyString(pluginRoot) ? [path.join(pluginRoot, "openclaw.plugin.json")] : []),

@@ -278,6 +415,7 @@ async function stopGateway(child) {

278415

async function waitForReady(params) {

279416

const started = Date.now();

280417

let lastError = "";

418+

const readyLogSeen = createReadyLogScanner(params.logPath);

281419

while (Date.now() - started < READY_TIMEOUT_MS) {

282420

if (params.child.exitCode !== null) {

283421

throw new Error(`gateway exited before ready\n${tailFile(params.logPath)}`);

@@ -291,19 +429,14 @@ async function waitForReady(params) {

291429

} catch (error) {

292430

lastError = error instanceof Error ? error.message : String(error);

293431

}

294-

if (logShowsGatewayReady(params.logPath) && (await httpOk(params.port, "/healthz"))) {

432+

if (readyLogSeen() && (await httpOk(params.port, "/healthz"))) {

295433

return;

296434

}

297435

await delay(250);

298436

}

299437

throw new Error(`gateway did not become ready: ${lastError}\n${tailFile(params.logPath)}`);

300438

}

301439302-

function logShowsGatewayReady(logPath) {

303-

const log = fs.existsSync(logPath) ? fs.readFileSync(logPath, "utf8") : "";

304-

return log.includes("[gateway] ready");

305-

}

306-307440

async function fetchHttpProbeStatus(port, pathName, options = {}) {

308441

const { timeoutMs = HTTP_PROBE_TIMEOUT_MS } = options;

309442

const controller = new AbortController();

@@ -638,32 +771,47 @@ function assertSpeechProviderVisible(payload, provider, label) {

638771

}

639772640773

async function runWatchdog(options) {

641-

const readyIndex = findReadyLogIndex(options.logPath);

774+

const readyOffset = findReadyLogOffset(options.logPath);

642775

await delay(WATCHDOG_MS);

643776

if (options.child.exitCode !== null) {

644777

throw new Error(

645778

`gateway exited after ready for ${options.pluginId}\n${tailFile(options.logPath)}`,

646779

);

647780

}

648781

await retryRpcCall("health", {}, options);

649-

assertNoPostReadyRuntimeDepsWork(options.logPath, readyIndex);

782+

assertNoPostReadyRuntimeDepsWork(options.logPath, readyOffset);

650783

await assertNoPackageManagerChildren(options.child.pid);

651784

}

652785653-

function findReadyLogIndex(logPath) {

654-

const log = fs.existsSync(logPath) ? fs.readFileSync(logPath, "utf8") : "";

655-

const candidates = ["[gateway] ready", "listening on ws://", "[gateway] http server listening"];

656-

const indexes = candidates.map((needle) => log.indexOf(needle)).filter((index) => index >= 0);

657-

return indexes.length > 0 ? Math.min(...indexes) : 0;

786+

export function findReadyLogOffset(logPath) {

787+

return findFirstNeedleOffset(logPath, READY_OFFSET_LOG_NEEDLES);

658788

}

659789660-

function assertNoPostReadyRuntimeDepsWork(logPath, readyIndex) {

661-

const log = fs.existsSync(logPath) ? fs.readFileSync(logPath, "utf8") : "";

662-

const postReady = log.slice(Math.max(0, readyIndex));

663-

const forbidden = [/\b(?:npm|pnpm|yarn|corepack) install\b/iu];

664-

const match = forbidden.find((pattern) => pattern.test(postReady));

665-

if (match) {

666-

throw new Error(`post-ready runtime dependency work matched ${match}: ${tailText(postReady)}`);

790+

export function assertNoPostReadyRuntimeDepsWork(logPath, readyOffset) {

791+

let stat;

792+

try {

793+

stat = fs.statSync(logPath);

794+

} catch {

795+

return;

796+

}

797+

if (!stat.isFile() || stat.size <= 0) {

798+

return;

799+

}

800+801+

let offset = Math.min(Math.max(0, Math.floor(Number(readyOffset) || 0)), stat.size);

802+

let carry = "";

803+

while (offset < stat.size) {

804+

const { buffer } = readFileChunk(logPath, offset, LOG_SCAN_BYTES);

805+

if (buffer.length === 0) {

806+

break;

807+

}

808+

const text = carry + buffer.toString("utf8");

809+

const match = FORBIDDEN_POST_READY_DEPS_WORK.find((pattern) => pattern.test(text));

810+

if (match) {

811+

throw new Error(`post-ready runtime dependency work matched ${match}: ${tailText(text)}`);

812+

}

813+

carry = text.slice(-256);

814+

offset += buffer.length;

667815

}

668816

}

669817

@@ -831,10 +979,7 @@ export function createIsolatedStateEnv(label) {

831979

}

832980833981

function tailFile(file) {

834-

if (!fs.existsSync(file)) {

835-

return "";

836-

}

837-

return tailText(fs.readFileSync(file, "utf8"));

982+

return tailText(readFileTail(file));

838983

}

839984840985

function tailText(text) {