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

推荐订阅源

腾讯CDC
The Cloudflare Blog
IT之家
IT之家
V
V2EX
雷峰网
雷峰网
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
S
SegmentFault 最新的问题
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
小众软件
小众软件
博客园 - 叶小钗
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
A
About on SuperTechFans
B
Blog
月光博客
月光博客
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI

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(e2e): scope strict ClawHub preflight limits · opencla...
vincentkoc · 2026-05-30 · via Recent Commits to openclaw:main
11

import fs from "node:fs";

22

import os from "node:os";

33

import path from "node:path";

4+

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

4556

const command = process.argv[2];

67

const scratchRoot = process.env.OPENCLAW_PLUGINS_TMP_DIR || os.tmpdir();

7-

const CLAWHUB_PREFLIGHT_TIMEOUT_MS = readPositiveInt(

8-

process.env.OPENCLAW_PLUGINS_E2E_CLAWHUB_PREFLIGHT_TIMEOUT_MS,

9-

30_000,

10-

);

11-

const CLAWHUB_PREFLIGHT_BODY_MAX_BYTES = readPositiveInt(

12-

process.env.OPENCLAW_PLUGINS_E2E_CLAWHUB_PREFLIGHT_BODY_MAX_BYTES,

13-

1024 * 1024,

14-

);

158

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

169

const scratchFile = (name) => path.join(scratchRoot, name);

171018-

function readPositiveInt(raw, fallback) {

19-

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

20-

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

11+

function readClawHubPreflightLimits() {

12+

return {

13+

bodyMaxBytes: readPositiveIntEnv(

14+

"OPENCLAW_PLUGINS_E2E_CLAWHUB_PREFLIGHT_BODY_MAX_BYTES",

15+

1024 * 1024,

16+

),

17+

timeoutMs: readPositiveIntEnv(

18+

"OPENCLAW_PLUGINS_E2E_CLAWHUB_PREFLIGHT_TIMEOUT_MS",

19+

30_000,

20+

),

21+

};

2122

}

22232324

function createTimeoutError(label, timeoutMs) {

@@ -826,6 +827,7 @@ async function assertClawHubPreflight() {

826827

throw new Error(`expected clawhub: spec, got ${spec}`);

827828

}

828829830+

const limits = readClawHubPreflightLimits();

829831

const packageName = parseClawHubPackageName(spec);

830832

const baseUrl = (

831833

process.env.OPENCLAW_CLAWHUB_URL ||

@@ -840,7 +842,7 @@ async function assertClawHubPreflight() {

840842

const preflightUrl = `${baseUrl}/api/v1/packages/${encodeURIComponent(packageName)}`;

841843

const response = await withTimeout(

842844

`ClawHub package preflight for ${packageName}`,

843-

CLAWHUB_PREFLIGHT_TIMEOUT_MS,

845+

limits.timeoutMs,

844846

(signal) =>

845847

fetch(preflightUrl, {

846848

headers: token ? { Authorization: `Bearer ${token}` } : undefined,

@@ -850,12 +852,12 @@ async function assertClawHubPreflight() {

850852

if (!response.ok) {

851853

const body = await withTimeout(

852854

`ClawHub package preflight response for ${packageName}`,

853-

CLAWHUB_PREFLIGHT_TIMEOUT_MS,

855+

limits.timeoutMs,

854856

() =>

855857

readBoundedResponseText(

856858

response,

857859

`ClawHub package preflight response for ${packageName}`,

858-

CLAWHUB_PREFLIGHT_BODY_MAX_BYTES,

860+

limits.bodyMaxBytes,

859861

),

860862

);

861863

throw new Error(

@@ -864,17 +866,17 @@ async function assertClawHubPreflight() {

864866

}

865867

const rawDetail = await withTimeout(

866868

`ClawHub package preflight response for ${packageName}`,

867-

CLAWHUB_PREFLIGHT_TIMEOUT_MS,

869+

limits.timeoutMs,

868870

() =>

869871

readBoundedResponseText(

870872

response,

871873

`ClawHub package preflight response for ${packageName}`,

872-

CLAWHUB_PREFLIGHT_BODY_MAX_BYTES,

874+

limits.bodyMaxBytes,

873875

),

874876

);

875877

const detail = await withTimeout(

876878

`ClawHub package preflight JSON for ${packageName}`,

877-

CLAWHUB_PREFLIGHT_TIMEOUT_MS,

879+

limits.timeoutMs,

878880

() => JSON.parse(rawDetail),

879881

);

880882

const family = detail.package?.family;