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

推荐订阅源

量子位
WordPress大学
WordPress大学
小众软件
小众软件
云风的 BLOG
云风的 BLOG
IT之家
IT之家
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
宝玉的分享
宝玉的分享
博客园 - Franky
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
D
Docker
博客园 - 聂微东
C
Check Point Blog
H
Help Net Security

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(provider): retry post status and download deadlines ·...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -267,6 +267,35 @@ describe("provider operation deadlines", () => {

267267

expect(fetchFn).toHaveBeenCalledTimes(2);

268268

expect(sleep).toHaveBeenCalledWith(0, undefined);

269269

});

270+271+

it("recomputes remaining download timeout before retry attempts", async () => {

272+

vi.useFakeTimers();

273+

vi.setSystemTime(1_000);

274+

const sleep = vi.fn(async () => undefined);

275+

const fetchFn = vi.fn<typeof fetch>(async () => {

276+

vi.setSystemTime(2_001);

277+

throw Object.assign(new Error("socket hang up"), { code: "ECONNRESET" });

278+

});

279+

const deadline = createProviderOperationDeadline({

280+

label: "video download",

281+

timeoutMs: 1_000,

282+

});

283+284+

await expect(

285+

fetchProviderDownloadResponse({

286+

url: "https://cdn.example.com/video.mp4",

287+

init: { method: "GET" },

288+

timeoutMs: () => resolveProviderOperationTimeoutMs({ deadline, defaultTimeoutMs: 5_000 }),

289+

fetchFn,

290+

provider: "test-video",

291+

requestFailedMessage: "download failed",

292+

retry: { attempts: 2, baseDelayMs: 0, maxDelayMs: 0, sleep },

293+

}),

294+

).rejects.toThrow("video download timed out after 1000ms");

295+296+

expect(fetchFn).toHaveBeenCalledTimes(1);

297+

expect(sleep).toHaveBeenCalledWith(0, undefined);

298+

});

270299

});

271300272301

describe("resolveProviderHttpRequestConfig", () => {

@@ -546,6 +575,39 @@ describe("fetchWithTimeoutGuarded", () => {

546575

expect(sleep).toHaveBeenCalledWith(0, undefined);

547576

});

548577578+

it("retries read JSON POST transient HTTP responses", async () => {

579+

fetchWithSsrFGuardMock.mockReset();

580+

const firstRelease = vi.fn(async () => undefined);

581+

const secondRelease = vi.fn(async () => undefined);

582+

const sleep = vi.fn(async () => undefined);

583+

fetchWithSsrFGuardMock

584+

.mockResolvedValueOnce({

585+

response: new Response("busy", { status: 503, statusText: "Service Unavailable" }),

586+

finalUrl: "https://api.example.com",

587+

release: firstRelease,

588+

})

589+

.mockResolvedValueOnce({

590+

response: new Response(null, { status: 200 }),

591+

finalUrl: "https://api.example.com",

592+

release: secondRelease,

593+

});

594+595+

const result = await postJsonRequest({

596+

url: "https://api.example.com/v1/analyze",

597+

headers: new Headers(),

598+

body: { media: "base64" },

599+

fetchFn: fetch,

600+

retryStage: "read",

601+

retry: { attempts: 2, baseDelayMs: 0, maxDelayMs: 0, sleep },

602+

});

603+604+

expect(result.response.status).toBe(200);

605+

expect(fetchWithSsrFGuardMock).toHaveBeenCalledTimes(2);

606+

expect(firstRelease).toHaveBeenCalledOnce();

607+

expect(secondRelease).not.toHaveBeenCalled();

608+

expect(sleep).toHaveBeenCalledWith(0, undefined);

609+

});

610+549611

it("forwards explicit pinDns overrides to transcription requests", async () => {

550612

fetchWithSsrFGuardMock.mockResolvedValue({

551613

response: new Response(null, { status: 200 }),