Replies: 1 comment
注入点我核到了,而且你说的"rc.2 零差异"也成立1. 全局 dispatcher 确实被装上
undici.setGlobalDispatcher(direct) // :197
…
const { getGlobalDispatcher, setGlobalDispatcher } = await import('undici') // :209
setGlobalDispatcher(agent) // :213⇒ 也就是说这个包从 npm 的 2.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
摘要
0.1.7-rc.1 升级引入的
@deepseek-ai/dsh-http-proxy(依赖undici: ^8.10.0,实际解析到 8.11.0)在检测到HTTP_PROXY/HTTPS_PROXY时,把 npm undici 8.x 的 Agent 安装为进程全局 dispatcher。实测确认:外部 undici 8.x dispatcher 与 Node 内置 fetch(内置 undici 6.28.0)存在响应头接口错配——安装后进程内所有经内置fetch()的响应Headers对象为空(status/body 正常)。0.1.7-rc.2 的dsh-http-proxy/lib/index.js与 rc.1 零差异,依赖声明仍为^8.10.0,问题未修复。两个实际故障(同一根因)
server is disconnected(stdio 型 zai 正常)content-type→null→SdkError: Unexpected content type: null,静默重试 10 次后放弃CHANNEL_DELIVERY),文字正常x-encrypted-param→ 缺失 →invalid-upload-response最小复现(与代理无关,纯接口错配)
Node
v22.23.2(内置 undici6.28.0):版本矩阵(同一台机器、同一时段实测)
抓包(tcpdump)佐证:请求正常发出、对端完整返回了头部块,客户端
Headers对象却为空——损坏发生在客户端响应头交接,不在网络。NO_PROXYbypass 本身工作正常(流量确实直连),与路由无关。定位
packages/util/http-proxy/src/install.ts→createPolicyDispatcher():Agent({ factory })→new Pool(origin, options)(8.x)设为全局。verify-no-bare-dispatcher只能 gate 仓库内源码,第三方插件(如 dsh-im 的微信 CDN 上传)受此影响却无法被 lint 覆盖。建议
dsh-http-proxy的 undici 依赖改为与 Node 内置主版本一致(Node 22 线内置 6.x;或锁定7.29.x,实测兼容),或在安装全局分发器前校验process.versions.undici主版本、不匹配时拒绝安装并告警。node_modules里的 undici 替换为 7.29.0 → MCP 三台恢复在线、微信图片发送恢复,代理功能不受影响。环境与佐证
0.1.7-rc.1(已核对 rc.2 的 dsh-http-proxy 与 rc.1 零差异、依赖仍^8.10.0)v22.23.2(内置 undici6.28.0),Linux x86_64(NAS 自部署)以上内容为AI生成总结
All reactions