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

推荐订阅源

G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
A
About on SuperTechFans
量子位
Engineering at Meta
Engineering at Meta
B
Blog
The Cloudflare Blog
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Y
Y Combinator Blog
J
Java Code Geeks
D
DataBreaches.Net
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
H
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
酷 壳 – CoolShell
酷 壳 – CoolShell

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): cancel beta verifier status bodies · opencl...
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -279,6 +279,7 @@ async function fetchWithRetry(

279279

if (response.status !== 429 && response.status < 500) {

280280

return { response, signal };

281281

}

282+

await cancelResponseBody(response);

282283

lastError = new Error(`HTTP ${response.status}`);

283284

} catch (error) {

284285

lastError = error;

@@ -293,6 +294,10 @@ async function fetchWithRetry(

293294

throw new Error(`${url} did not return a stable response: ${message}`);

294295

}

295296
297+

async function cancelResponseBody(response: Response): Promise<void> {

298+

await response.body?.cancel().catch(() => undefined);

299+

}

300+
296301

async function fetchJsonWithRetry(url: string): Promise<unknown> {

297302

const { response, signal } = await fetchWithRetry(

298303

url,

@@ -314,9 +319,13 @@ export async function readBoundedJsonResponse(

314319

return parseJson(await readBoundedResponseText(response, label, maxBytes, options), label);

315320

}

316321
317-

async function fetchStatusWithRetry(url: string, method: "GET" | "HEAD"): Promise<number> {

322+

export async function fetchStatusWithRetry(url: string, method: "GET" | "HEAD"): Promise<number> {

318323

const { response } = await fetchWithRetry(url, { method, redirect: "manual" }, 5);

319-

return response.status;

324+

try {

325+

return response.status;

326+

} finally {

327+

await cancelResponseBody(response);

328+

}

320329

}

321330
322331

async function verifyNpmPackage(

Original file line numberDiff line numberDiff line change

@@ -1,12 +1,18 @@

11

// Release Beta Verifier tests cover release beta verifier script behavior.

2-

import { describe, expect, it } from "vitest";

2+

import { afterEach, describe, expect, it, vi } from "vitest";

33

import {

4+

fetchStatusWithRetry,

45

parseNpmViewFields,

56

parseReleaseVerifyBetaArgs,

67

readBoundedJsonResponse,

78

runNpmViewWithRetry,

89

} from "../../scripts/lib/release-beta-verifier.ts";

910
11+

afterEach(() => {

12+

vi.unstubAllGlobals();

13+

vi.useRealTimers();

14+

});

15+
1016

describe("parseReleaseVerifyBetaArgs", () => {

1117

it("defaults beta verification to the matching tag and repo", () => {

1218

expect(parseReleaseVerifyBetaArgs(["2026.5.10-beta.3"])).toEqual({

@@ -152,6 +158,46 @@ describe("runNpmViewWithRetry", () => {

152158

});

153159

});

154160
161+

describe("fetchStatusWithRetry", () => {

162+

it("cancels retryable and returned GET response bodies", async () => {

163+

vi.useFakeTimers();

164+

const canceled: string[] = [];

165+

const responses = [

166+

new Response(

167+

new ReadableStream<Uint8Array>({

168+

cancel() {

169+

canceled.push("retry");

170+

},

171+

}),

172+

{ status: 500 },

173+

),

174+

new Response(

175+

new ReadableStream<Uint8Array>({

176+

cancel() {

177+

canceled.push("final");

178+

},

179+

}),

180+

{ status: 200 },

181+

),

182+

];

183+

const fetchImpl = vi.fn(async () => {

184+

const response = responses.shift();

185+

if (!response) {

186+

throw new Error("unexpected fetch call");

187+

}

188+

return response;

189+

});

190+

vi.stubGlobal("fetch", fetchImpl);

191+
192+

const status = fetchStatusWithRetry("https://clawhub.test/api/v1/package", "GET");

193+

await vi.advanceTimersByTimeAsync(1000);

194+
195+

await expect(status).resolves.toBe(200);

196+

expect(canceled).toEqual(["retry", "final"]);

197+

expect(fetchImpl).toHaveBeenCalledTimes(2);

198+

});

199+

});

200+
155201

describe("readBoundedJsonResponse", () => {

156202

it("parses JSON bodies within the release verifier limit", async () => {

157203

await expect(