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

推荐订阅源

V
V2EX
量子位
博客园 - 司徒正美
IT之家
IT之家
V
Visual Studio Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
Microsoft Security Blog
Microsoft Security Blog
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏
GbyAI
GbyAI
Vercel News
Vercel News
B
Blog
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
小众软件
小众软件
罗磊的独立博客
博客园 - 叶小钗
雷峰网
雷峰网
Martin Fowler
Martin Fowler
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学

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: prevent embedded runs from lowering undici timeouts ...
steipete · 2026-04-24 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -15,6 +15,7 @@ Docs: https://docs.openclaw.ai

1515
1616

### Fixes

1717
18+

- Agents/transport: stop embedded runs from lowering the process-wide undici stream timeouts, so slow Gemini image generation and other long-running provider requests no longer inherit short run-attempt headers timeouts. Fixes #70423. Thanks @giangthb.

1819

- Memory/QMD: recreate stale managed QMD collections when startup repair finds the collection name already exists, so root memory narrows back to `MEMORY.md` instead of staying on broad workspace markdown indexing.

1920

- Agents/OpenAI: surface selected-model capacity failures from PI, Codex, and auto-reply harness paths with a model-switch hint instead of the generic empty-response error. Thanks @vincentkoc.

2021

- Providers/OpenAI: route `openai/gpt-image-2` through configured Codex OAuth directly when an `openai-codex` profile is active, instead of probing `OPENAI_API_KEY` first.

Original file line numberDiff line numberDiff line change

@@ -1,4 +1,5 @@

11

import {

2+

DEFAULT_UNDICI_STREAM_TIMEOUT_MS,

23

ensureGlobalUndiciEnvProxyDispatcher,

34

ensureGlobalUndiciStreamTimeouts,

45

} from "../../../infra/net/undici-global-dispatcher.js";

@@ -7,5 +8,7 @@ export function configureEmbeddedAttemptHttpRuntime(params: { timeoutMs: number

78

// Proxy bootstrap must happen before timeout tuning so the timeouts wrap the

89

// active EnvHttpProxyAgent instead of being replaced by a bare proxy dispatcher.

910

ensureGlobalUndiciEnvProxyDispatcher();

10-

ensureGlobalUndiciStreamTimeouts({ timeoutMs: params.timeoutMs });

11+

ensureGlobalUndiciStreamTimeouts({

12+

timeoutMs: Math.max(params.timeoutMs, DEFAULT_UNDICI_STREAM_TIMEOUT_MS),

13+

});

1114

}

Original file line numberDiff line numberDiff line change

@@ -1,11 +1,13 @@

11

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

22
33

const mocks = vi.hoisted(() => ({

4+

DEFAULT_UNDICI_STREAM_TIMEOUT_MS: 30 * 60 * 1000,

45

ensureGlobalUndiciEnvProxyDispatcher: vi.fn(),

56

ensureGlobalUndiciStreamTimeouts: vi.fn(),

67

}));

78
89

vi.mock("../../../infra/net/undici-global-dispatcher.js", () => ({

10+

DEFAULT_UNDICI_STREAM_TIMEOUT_MS: mocks.DEFAULT_UNDICI_STREAM_TIMEOUT_MS,

911

ensureGlobalUndiciEnvProxyDispatcher: mocks.ensureGlobalUndiciEnvProxyDispatcher,

1012

ensureGlobalUndiciStreamTimeouts: mocks.ensureGlobalUndiciStreamTimeouts,

1113

}));

@@ -18,12 +20,23 @@ describe("runEmbeddedAttempt undici timeout wiring", () => {

1820

mocks.ensureGlobalUndiciStreamTimeouts.mockReset();

1921

});

2022
21-

it("forwards the configured run timeout into global undici stream tuning", () => {

23+

it("does not lower global undici stream tuning below the shared default", () => {

2224

configureEmbeddedAttemptHttpRuntime({ timeoutMs: 123_456 });

2325
2426

expect(mocks.ensureGlobalUndiciEnvProxyDispatcher).toHaveBeenCalledOnce();

2527

expect(mocks.ensureGlobalUndiciStreamTimeouts).toHaveBeenCalledWith({

26-

timeoutMs: 123_456,

28+

timeoutMs: mocks.DEFAULT_UNDICI_STREAM_TIMEOUT_MS,

29+

});

30+

});

31+
32+

it("preserves run timeouts above the shared default", () => {

33+

const timeoutMs = mocks.DEFAULT_UNDICI_STREAM_TIMEOUT_MS + 1_000;

34+
35+

configureEmbeddedAttemptHttpRuntime({ timeoutMs });

36+
37+

expect(mocks.ensureGlobalUndiciEnvProxyDispatcher).toHaveBeenCalledOnce();

38+

expect(mocks.ensureGlobalUndiciStreamTimeouts).toHaveBeenCalledWith({

39+

timeoutMs,

2740

});

2841

});

2942

});

Original file line numberDiff line numberDiff line change

@@ -142,6 +142,26 @@ describe("ensureGlobalUndiciStreamTimeouts", () => {

142142

expect(setGlobalDispatcher).toHaveBeenCalledTimes(1);

143143

});

144144
145+

it("does not lower global stream timeouts below the default floor", () => {

146+

ensureGlobalUndiciStreamTimeouts({ timeoutMs: 15_000 });

147+
148+

expect(setGlobalDispatcher).toHaveBeenCalledTimes(1);

149+

const next = getCurrentDispatcher() as { options?: Record<string, unknown> };

150+

expect(next.options?.bodyTimeout).toBe(DEFAULT_UNDICI_STREAM_TIMEOUT_MS);

151+

expect(next.options?.headersTimeout).toBe(DEFAULT_UNDICI_STREAM_TIMEOUT_MS);

152+

});

153+
154+

it("honors explicit global stream timeouts above the default floor", () => {

155+

const timeoutMs = DEFAULT_UNDICI_STREAM_TIMEOUT_MS + 1_000;

156+
157+

ensureGlobalUndiciStreamTimeouts({ timeoutMs });

158+
159+

expect(setGlobalDispatcher).toHaveBeenCalledTimes(1);

160+

const next = getCurrentDispatcher() as { options?: Record<string, unknown> };

161+

expect(next.options?.bodyTimeout).toBe(timeoutMs);

162+

expect(next.options?.headersTimeout).toBe(timeoutMs);

163+

});

164+
145165

it("re-applies when autoSelectFamily decision changes", () => {

146166

getDefaultAutoSelectFamily.mockReturnValue(true);

147167

ensureGlobalUndiciStreamTimeouts();

Original file line numberDiff line numberDiff line change

@@ -110,10 +110,10 @@ export function ensureGlobalUndiciEnvProxyDispatcher(): void {

110110
111111

export function ensureGlobalUndiciStreamTimeouts(opts?: { timeoutMs?: number }): void {

112112

const timeoutMsRaw = opts?.timeoutMs ?? DEFAULT_UNDICI_STREAM_TIMEOUT_MS;

113-

const timeoutMs = Math.max(1, Math.floor(timeoutMsRaw));

114113

if (!Number.isFinite(timeoutMsRaw)) {

115114

return;

116115

}

116+

const timeoutMs = Math.max(DEFAULT_UNDICI_STREAM_TIMEOUT_MS, Math.floor(timeoutMsRaw));

117117

const kind = resolveCurrentDispatcherKind();

118118

if (kind === null) {

119119

return;