mqnu00/dsh-undici-timeout ↗★ 0

dsh-undici-timeout

A configurable direct channel for the DSH LLM egress: a keep-alive undici Agent with adjustable connect/headers/body/keep-alive timeouts, IPv4-forcing, HTTP/2 off by default, automatic stand-down behind a proxy, and a read-only status route. 适合需要优化网络连接、强制 IPv4 或自定义请求超时时间的用户。

Package
dsh-undici-timeout
Compatibility
Unverified
Version
0.1.1
License
MIT
Last updated
Oct 15, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:mqnu00/dsh-undici-timeout

配置项(cordis.patch.yml 里本插件的 config:)

键默认说明
enabledtrue总开关。false 时不改 fetch,状态路由仍在。
hosts["opencode.ai"]命中这些域名(含子域)才接管;"*" = 全部直连流量。
connectTimeoutMs30000核心项。DNS+TCP+TLS 的总预算(内置固定 10s)。范围 1000–600000。
headersTimeoutMs300000等响应头。
bodyTimeoutMs0相邻 body 块间隔;0=关闭,卡流交给 pi-ai 的 streamIdleTimeoutMs 看门狗。
keepAliveTimeoutMs60000空闲连接保留时长(复用 = 不重握手)。
keepAliveMaxTimeoutMs600000保活上限。
pipelining1每连接并发请求数。
family00=跟随系统;4/6=强制 IP 族(本机 IPv6 无出口时 4 很划算)。
allowH2false⚠️ 见下面「h2 的坑」。undici 8 把 allowH2 的默认值翻成了 true,不显式关掉,本插件会顺手把 LLM 出口从 h1 换成 h2。
autoSelectFamilyAttemptTimeoutMs0Node happy-eyeballs 的地址轮换间隔(默认 250ms)。注意:尝试是并行保留的,这个值不是单地址的放弃窗口——黑洞地址实测默认与调大都会等到 connect 超时才死,改大只会拖慢轮换,一般别动。保留它只为极端调优。
delegateOnProxyEnvtrue有代理 env 时让路。
undiciPath""留空自动解析;可显式指到某份 undici/index.js。
probeOnStarttrue启动时打一次探针(默认打 LLM 网关的 models 端点,不花 token)。
probeUrl / probeTimeoutMs…/zen/go/v1/models / 15000探针目标与超时。
logSlowMs0>0 时把达到该耗时的请求写日志。
logFailurestrue失败请求记日志(含 cause)。
routePath/_dsh/undici-timeout状态路由。
logFile$DSH_HOME/logs/dsh-undici-timeout/host.log日志落盘。