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

推荐订阅源

Y
Y Combinator Blog
GbyAI
GbyAI
爱范儿
爱范儿
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Check Point Blog
M
MIT News - Artificial intelligence
量子位
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
罗磊的独立博客
F
Fortinet All Blogs
美团技术团队
博客园_首页
博客园 - 【当耐特】
L
LangChain Blog
月光博客
月光博客
腾讯CDC
The Cloudflare Blog
D
Docker
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

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: propagate timeoutMs to guarded dispatchers (local LL...
DranboFields · 2026-04-24 · via Recent Commits to openclaw:main

@@ -19,12 +19,25 @@ import {

1919

SsrFBlockedError,

2020

type SsrFPolicy,

2121

} from "./ssrf.js";

22+

import { _globalUndiciStreamTimeoutMs } from "./undici-global-dispatcher.js";

2223

import {

2324

createHttp1Agent,

2425

createHttp1EnvHttpProxyAgent,

2526

createHttp1ProxyAgent,

2627

} from "./undici-runtime.js";

272829+

function resolveDispatcherTimeoutMs(fromParams: number | undefined): number | undefined {

30+

if (fromParams !== undefined) {

31+

return fromParams;

32+

}

33+

// Fall back to module-level bridge set by ensureGlobalUndiciStreamTimeouts

34+

// (avoids reading Undici's non-public `.options` field)

35+

if (_globalUndiciStreamTimeoutMs !== undefined) {

36+

return _globalUndiciStreamTimeoutMs;

37+

}

38+

return undefined;

39+

}

40+2841

type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;

29423043

export const GUARDED_FETCH_MODE = {

@@ -125,6 +138,7 @@ function assertExplicitProxySupportsPinnedDns(

125138126139

function createPolicyDispatcherWithoutPinnedDns(

127140

dispatcherPolicy?: PinnedDispatcherPolicy,

141+

timeoutMs?: number,

128142

): Dispatcher | null {

129143

if (!dispatcherPolicy) {

130144

return null;

@@ -133,23 +147,28 @@ function createPolicyDispatcherWithoutPinnedDns(

133147

if (dispatcherPolicy.mode === "direct") {

134148

return createHttp1Agent(

135149

dispatcherPolicy.connect ? { connect: { ...dispatcherPolicy.connect } } : undefined,

150+

timeoutMs,

136151

);

137152

}

138153139154

if (dispatcherPolicy.mode === "env-proxy") {

140-

return createHttp1EnvHttpProxyAgent({

141-

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

142-

...(dispatcherPolicy.proxyTls ? { proxyTls: { ...dispatcherPolicy.proxyTls } } : {}),

143-

});

155+

return createHttp1EnvHttpProxyAgent(

156+

{

157+

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

158+

...(dispatcherPolicy.proxyTls ? { proxyTls: { ...dispatcherPolicy.proxyTls } } : {}),

159+

},

160+

timeoutMs,

161+

);

144162

}

145163146164

const proxyUrl = dispatcherPolicy.proxyUrl.trim();

147-

return dispatcherPolicy.proxyTls

148-

? createHttp1ProxyAgent({

149-

uri: proxyUrl,

150-

requestTls: { ...dispatcherPolicy.proxyTls },

151-

})

152-

: createHttp1ProxyAgent({ uri: proxyUrl });

165+

if (dispatcherPolicy.proxyTls) {

166+

return createHttp1ProxyAgent(

167+

{ uri: proxyUrl, requestTls: { ...dispatcherPolicy.proxyTls } },

168+

timeoutMs,

169+

);

170+

}

171+

return createHttp1ProxyAgent({ uri: proxyUrl }, timeoutMs);

153172

}

154173155174

async function assertExplicitProxyAllowed(

@@ -337,25 +356,31 @@ export async function fetchWithSsrFGuard(params: GuardedFetchOptions): Promise<G

337356

await assertExplicitProxyAllowed(params.dispatcherPolicy, params.lookupFn, params.policy);

338357

const canUseTrustedEnvProxy =

339358

mode === GUARDED_FETCH_MODE.TRUSTED_ENV_PROXY && hasProxyEnvConfigured();

359+

const timeoutMs = resolveDispatcherTimeoutMs(params.timeoutMs);

340360

if (canUseTrustedEnvProxy) {

341-

dispatcher = createHttp1EnvHttpProxyAgent();

361+

dispatcher = createHttp1EnvHttpProxyAgent(undefined, timeoutMs);

342362

} else if (usesTrustedExplicitProxyMode) {

343363

// Explicit proxy targets are still checked against the caller's hostname

344364

// policy, but the proxy does the DNS resolution for the final target.

345365

assertHostnameAllowedWithPolicy(parsedUrl.hostname, params.policy);

346-

dispatcher = createPolicyDispatcherWithoutPinnedDns(params.dispatcherPolicy);

366+

dispatcher = createPolicyDispatcherWithoutPinnedDns(params.dispatcherPolicy, timeoutMs);

347367

} else if (params.pinDns === false) {

348368

await resolvePinnedHostnameWithPolicy(parsedUrl.hostname, {

349369

lookupFn: params.lookupFn,

350370

policy: params.policy,

351371

});

352-

dispatcher = createPolicyDispatcherWithoutPinnedDns(params.dispatcherPolicy);

372+

dispatcher = createPolicyDispatcherWithoutPinnedDns(params.dispatcherPolicy, timeoutMs);

353373

} else {

354374

const pinned = await resolvePinnedHostnameWithPolicy(parsedUrl.hostname, {

355375

lookupFn: params.lookupFn,

356376

policy: params.policy,

357377

});

358-

dispatcher = createPinnedDispatcher(pinned, params.dispatcherPolicy, params.policy);

378+

dispatcher = createPinnedDispatcher(

379+

pinned,

380+

params.dispatcherPolicy,

381+

params.policy,

382+

timeoutMs,

383+

);

359384

}

360385361386

const init: DispatcherAwareRequestInit = {