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

推荐订阅源

Google DeepMind News
Google DeepMind News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
小众软件
小众软件
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
雷峰网
雷峰网
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
T
Tailwind CSS Blog
Martin Fowler
Martin Fowler
I
InfoQ
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
The Cloudflare Blog
罗磊的独立博客

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(release): bound cross-os fetch bodies · openclaw/open...
vincentkoc · 2026-05-28 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -120,6 +120,7 @@ const OMITTED_QA_EXTENSION_PREFIXES = [

120120

];

121121

export const CROSS_OS_DASHBOARD_SMOKE_TIMEOUT_MS = 120_000;

122122

export const CROSS_OS_DASHBOARD_FETCH_TIMEOUT_MS = 10_000;

123+

export const CROSS_OS_FETCH_BODY_MAX_CHARS = 1024 * 1024;

123124

export const CROSS_OS_GATEWAY_STATUS_RPC_TIMEOUT_MS = 30_000;

124125

export const CROSS_OS_GATEWAY_STATUS_COMMAND_TIMEOUT_MS =

125126

CROSS_OS_GATEWAY_STATUS_RPC_TIMEOUT_MS + 45_000;

@@ -2462,6 +2463,45 @@ async function configureDiscordSmoke(params) {

24622463

});

24632464

}

24642465
2466+

export async function readBoundedCrossOsResponseText(

2467+

response: Response,

2468+

maxChars = CROSS_OS_FETCH_BODY_MAX_CHARS,

2469+

): Promise<string> {

2470+

if (!response.body) {

2471+

return "";

2472+

}

2473+
2474+

const reader = response.body.getReader();

2475+

const decoder = new TextDecoder();

2476+

let text = "";

2477+

let truncated = false;

2478+
2479+

try {

2480+

while (text.length <= maxChars) {

2481+

const { done, value } = await reader.read();

2482+

if (done) {

2483+

text += decoder.decode();

2484+

break;

2485+

}

2486+
2487+

text += decoder.decode(value, { stream: true });

2488+

if (text.length > maxChars) {

2489+

text = text.slice(0, maxChars);

2490+

truncated = true;

2491+

break;

2492+

}

2493+

}

2494+

} finally {

2495+

if (truncated) {

2496+

await reader.cancel().catch(() => undefined);

2497+

} else {

2498+

reader.releaseLock();

2499+

}

2500+

}

2501+
2502+

return truncated ? `${text}\n[truncated]` : text;

2503+

}

2504+
24652505

async function waitForDiscordMessage(params) {

24662506

const deadline = Date.now() + 3 * 60 * 1000;

24672507

while (Date.now() < deadline) {

@@ -2473,7 +2513,7 @@ async function waitForDiscordMessage(params) {

24732513

},

24742514

},

24752515

);

2476-

const text = await response.text();

2516+

const text = await readBoundedCrossOsResponseText(response);

24772517

if (!response.ok) {

24782518

await sleep(2_000);

24792519

continue;

@@ -2501,7 +2541,7 @@ async function postDiscordMessage(params) {

25012541

}),

25022542

},

25032543

);

2504-

const text = await response.text();

2544+

const text = await readBoundedCrossOsResponseText(response);

25052545

if (!response.ok) {

25062546

throw new Error(`Failed to post Discord smoke message: ${text}`);

25072547

}

@@ -3292,7 +3332,7 @@ async function runDashboardSmoke(params) {

32923332

const response = await fetch(dashboardUrl, {

32933333

signal: AbortSignal.timeout(CROSS_OS_DASHBOARD_FETCH_TIMEOUT_MS),

32943334

});

3295-

const html = await response.text();

3335+

const html = await readBoundedCrossOsResponseText(response);

32963336

if (

32973337

response.ok &&

32983338

html.includes("<title>OpenClaw Control</title>") &&

Original file line numberDiff line numberDiff line change

@@ -28,6 +28,7 @@ import {

2828

canConnectToLoopbackPort,

2929

buildDiscordSmokeGuildsConfig,

3030

buildRealUpdateEnv,

31+

CROSS_OS_FETCH_BODY_MAX_CHARS,

3132

CROSS_OS_GATEWAY_READY_TIMEOUT_MS,

3233

CROSS_OS_GATEWAY_STATUS_COMMAND_TIMEOUT_MS,

3334

CROSS_OS_GATEWAY_STATUS_RPC_TIMEOUT_MS,

@@ -51,6 +52,7 @@ import {

5152

parseArgs,

5253

packageHasScript,

5354

readInstalledVersion,

55+

readBoundedCrossOsResponseText,

5456

readRunnerOverrideEnv,

5557

resolveCrossOsAgentTurnOptional,

5658

runCommand,

@@ -87,6 +89,17 @@ describe("scripts/openclaw-cross-os-release-checks", () => {

8789

expect(CROSS_OS_DASHBOARD_FETCH_TIMEOUT_MS).toBeGreaterThanOrEqual(10_000);

8890

});

8991
92+

it("bounds cross-OS fetched response bodies", async () => {

93+

const tail = "tail-sentinel-should-not-appear";

94+

const response = new Response(`${"x".repeat(5000)}${tail}`);

95+
96+

const text = await readBoundedCrossOsResponseText(response, 128);

97+
98+

expect(text).toContain("[truncated]");

99+

expect(text).not.toContain(tail);

100+

expect(CROSS_OS_FETCH_BODY_MAX_CHARS).toBeGreaterThan(1024);

101+

});

102+
90103

it("keeps gateway RPC status probes patient enough for live release startup", () => {

91104

expect(CROSS_OS_GATEWAY_STATUS_RPC_TIMEOUT_MS).toBeGreaterThanOrEqual(30_000);

92105

expect(CROSS_OS_GATEWAY_STATUS_COMMAND_TIMEOUT_MS).toBeGreaterThan(