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

推荐订阅源

小众软件
小众软件
B
Blog RSS Feed
美团技术团队
博客园 - 【当耐特】
C
Check Point Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
aimingoo的专栏
aimingoo的专栏
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
Vercel News
Vercel News
P
Proofpoint News Feed
IT之家
IT之家
I
InfoQ
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More

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: preserve embedded dispatcher timeouts · openclaw/ope...
shakkernerd · 2026-05-06 · via Recent Commits to openclaw:main

@@ -49,9 +49,17 @@ function resolveDispatcherKey(params: {

4949

return `${params.kind}:${params.timeoutMs}:${autoSelectToken}`;

5050

}

515152+

function resolveStreamTimeoutMs(opts?: { timeoutMs?: number }): number | null {

53+

const timeoutMsRaw = opts?.timeoutMs ?? DEFAULT_UNDICI_STREAM_TIMEOUT_MS;

54+

if (!Number.isFinite(timeoutMsRaw)) {

55+

return null;

56+

}

57+

return Math.max(DEFAULT_UNDICI_STREAM_TIMEOUT_MS, Math.floor(timeoutMsRaw));

58+

}

59+5260

function resolveCurrentDispatcherKind(

5361

runtime: Pick<UndiciGlobalDispatcherDeps, "getGlobalDispatcher">,

54-

): DispatcherKind | null {

62+

): Exclude<DispatcherKind, "unsupported"> | null {

5563

let dispatcher: unknown;

5664

try {

5765

dispatcher = runtime.getGlobalDispatcher();

@@ -92,19 +100,54 @@ export function ensureGlobalUndiciEnvProxyDispatcher(): void {

92100

}

93101

}

94102103+

function applyGlobalDispatcherStreamTimeouts(params: {

104+

runtime: UndiciGlobalDispatcherDeps;

105+

kind: Exclude<DispatcherKind, "unsupported">;

106+

timeoutMs: number;

107+

}): void {

108+

const { runtime, kind, timeoutMs } = params;

109+

const autoSelectFamily = resolveUndiciAutoSelectFamily();

110+

const nextKey = resolveDispatcherKey({ kind, timeoutMs, autoSelectFamily });

111+

if (lastAppliedTimeoutKey === nextKey) {

112+

return;

113+

}

114+115+

const connect = createUndiciAutoSelectFamilyConnectOptions(autoSelectFamily);

116+

try {

117+

if (kind === "env-proxy") {

118+

const proxyOptions = {

119+

...resolveEnvHttpProxyAgentOptions(),

120+

bodyTimeout: timeoutMs,

121+

headersTimeout: timeoutMs,

122+

...(connect ? { connect } : {}),

123+

} as ConstructorParameters<UndiciGlobalDispatcherDeps["EnvHttpProxyAgent"]>[0];

124+

runtime.setGlobalDispatcher(new runtime.EnvHttpProxyAgent(proxyOptions));

125+

} else {

126+

runtime.setGlobalDispatcher(

127+

new runtime.Agent({

128+

bodyTimeout: timeoutMs,

129+

headersTimeout: timeoutMs,

130+

...(connect ? { connect } : {}),

131+

}),

132+

);

133+

}

134+

lastAppliedTimeoutKey = nextKey;

135+

} catch {

136+

// Best-effort hardening only.

137+

}

138+

}

139+95140

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

96-

const timeoutMsRaw = opts?.timeoutMs ?? DEFAULT_UNDICI_STREAM_TIMEOUT_MS;

97-

if (!Number.isFinite(timeoutMsRaw)) {

141+

const timeoutMs = resolveStreamTimeoutMs(opts);

142+

if (timeoutMs === null) {

98143

return;

99144

}

100-

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

101145

_globalUndiciStreamTimeoutMs = timeoutMs;

102146

if (!hasEnvHttpProxyAgentConfigured()) {

103147

lastAppliedTimeoutKey = null;

104148

return;

105149

}

106150

const runtime = loadUndiciGlobalDispatcherDeps();

107-

const { EnvHttpProxyAgent, setGlobalDispatcher } = runtime;

108151

const kind = resolveCurrentDispatcherKind(runtime);

109152

if (kind === null) {

110153

return;

@@ -113,25 +156,21 @@ export function ensureGlobalUndiciStreamTimeouts(opts?: { timeoutMs?: number }):

113156

return;

114157

}

115158116-

const autoSelectFamily = resolveUndiciAutoSelectFamily();

117-

const nextKey = resolveDispatcherKey({ kind, timeoutMs, autoSelectFamily });

118-

if (lastAppliedTimeoutKey === nextKey) {

159+

applyGlobalDispatcherStreamTimeouts({ runtime, kind, timeoutMs });

160+

}

161+162+

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

163+

const timeoutMs = resolveStreamTimeoutMs(opts);

164+

if (timeoutMs === null) {

119165

return;

120166

}

121-122-

const connect = createUndiciAutoSelectFamilyConnectOptions(autoSelectFamily);

123-

try {

124-

const proxyOptions = {

125-

...resolveEnvHttpProxyAgentOptions(),

126-

bodyTimeout: timeoutMs,

127-

headersTimeout: timeoutMs,

128-

...(connect ? { connect } : {}),

129-

} as ConstructorParameters<UndiciGlobalDispatcherDeps["EnvHttpProxyAgent"]>[0];

130-

setGlobalDispatcher(new EnvHttpProxyAgent(proxyOptions));

131-

lastAppliedTimeoutKey = nextKey;

132-

} catch {

133-

// Best-effort hardening only.

167+

_globalUndiciStreamTimeoutMs = timeoutMs;

168+

const runtime = loadUndiciGlobalDispatcherDeps();

169+

const kind = resolveCurrentDispatcherKind(runtime);

170+

if (kind === null) {

171+

return;

134172

}

173+

applyGlobalDispatcherStreamTimeouts({ runtime, kind, timeoutMs });

135174

}

136175137176

export function resetGlobalUndiciStreamTimeoutsForTests(): void {