Repository navigation
Description
Description *
现象 / Symptom
DSH Desktop(profile web)装 billion-context 插件(plugin native)。压缩链路从未生效,模型流量全程未压缩直连:
DSH 设置 → bili 面板(dist/agent/dsh-native-client.js 的 degraded 文案)显示:
当前 dsh 进程未绑定 bili 代理(未经 bili dsh 启动,或代理尚未就绪)——先运行 /acp,或改用 bili dsh 启动。
/acp 返回:bili: no proxy detected — launch dsh through \bili dsh so /acp can read context status.
~/.local/state/billion-context/bili.log 每 10s 一行,连续 4 天共 6575 次:
代码块
[warn] [v=0.1.197] [dsh-client] proxy bootstrap failed — model traffic goes direct (uncompressed): bili: proxy child exited before becoming healthy (code 0) (log: C:\Users\dell\AppData\Local\Temp\bili-proxy-18787.log)
[error] [v=0.1.197] [native-client] bili-native: proxy not ready — model request goes direct (uncompressed): https://ws-3k…maas.aliyuncs.com/compatible-mode/v1/chat/completions
而那个 %TEMP%\bili-proxy-18787.log 已经 4,090,894 字节,内容 100% 是 Microsoft HPC Pack 的 node 帮助文本(16 行 help 反复重复),一行插件输出都没有。
复现步骤 / Steps to reproduce
Windows 上 PATH 里存在一个不是 Node.js 的 node.exe,且排在真 Node 之前 —— 本机即 C:\Program Files\Microsoft HPC Pack 2019\Bin\node.exe(机器 PATH 第 6 项;本机未安装 Node.js,where.exe node 只给出它)。
用非 Node 宿主启动 billion-context(plugin native)——本机是 DSH Desktop 2.0.17 的 Electron utility 进程。
观察:bili.log 每 10s 报一次 proxy child exited before becoming healthy (code 0);%TEMP%\bili-proxy-18787.log 被那个无关程序的 stdout 灌满;DSH 面板持续显示 degraded 文案。
(与用户配置无关:~/.config/billion-context/ 全默认;profile 只由插件自己的 dsh.bundle.patch.yml 把 compaction-basic.auto=false。)
根因 / Root cause(源码定位,0.1.197 / commit 3aeddc1)
dist/agent/dsh-native.js 的 resolveNodeRuntime():宿主自身不是 node 时先扫 PATH(extraDirs 排在 PATH 之后),最后才回退 Electron 自身二进制:
js
const base = path.basename(execPath).toLowerCase();
if (base === "node" || base === "node.exe") return execPath;
const override = env.BILLION_CONTEXT_NODE?.trim() ?? "";
if (override.length > 0 && existsImpl(override)) return override;
const resolveDiscovered = candidate => {
if (platform !== "win32") return candidate;
const target = probeWrapper(candidate, env);
if (target && target.trim().length > 0) {
const resolved = target.trim();
if (existsImpl(resolved) && resolved.toLowerCase() !== candidate.toLowerCase()) { /* #1887 */ return resolved }
}
return candidate; // ← 关键:probe 不成立时把候选原样接受
};
const extraDirs = ["C:/Program Files/nodejs", env.LOCALAPPDATA + "/Programs/nodejs", voltaHome + "/bin"];
for (const dir of [...(env.PATH ?? "").split(sep), ...extraDirs]) {
for (const name of ["node.exe"]) {
const candidate = dir + "/" + name;
if (existsImpl(candidate)) return resolveDiscovered(candidate); // ← PATH 先于 extraDirs
}
}
if (electronVersion && electronVersion.length > 0) return execPath; // ← 本该兜底的 Electron 回退永远到不了
throw new Error("bili: cannot find a Node runtime to spawn the proxy …");
probeNodeWrapperTarget() 只把 -p process.execPath 的任意非空 stdout 当"wrapper 目标路径":
js
function probeNodeWrapperTarget(candidate, env) {
try {
const out = execFileSync(candidate, ["-p", "process.execPath"], { windowsHide: true, timeout: 5e3, encoding: "utf8", stdio: ["ignore","pipe","pipe"], env });
const p = out.trim();
return p.length > 0 ? p : void 0; // ← 帮助文本也是"非空 stdout"
} catch { return void 0 }
}
Microsoft HPC Pack 的 node.exe 是集群 CLI,不认 -p:它忽略参数、把 16 行帮助打到 stdout、exit 0。于是 probe 拿到的是帮助文本 → existsImpl(帮助文本) 为 false → 走到 return candidate,把这个程序当成 Node 运行时。
spawn 点(同一个文件):
js
child = spawnImpl(deps.nodeRuntime ?? resolveNodeRuntime(),
[script, ...proxyStartArgs({ ...opts, port })],
{ detached: true, windowsHide: true, stdio: ["ignore", logFd, logFd],
env: { ...stripInheritedProxy(process.env), ...captureInheritedProxyEnv(process.env),
...process.versions.electron ? { ELECTRON_RUN_AS_NODE: "1" } : {}, ... } });
帮助文本进程即刻 exit 0 → proxy child exited before becoming healthy (code 0) → RETRY_INTERVAL_MS = 1e4 每 10s 重来,ZONE_PORT_BASE = 18787 固定端口,PORT_LOG_MAX_BYTES = 5MiB 才轮转,SPAWN_WAIT_MS = 2e4。
反证 / Counter-evidence
回退路径本身是好的 —— 用 Electron 自身二进制以纯 Node 跑同一入口:
代码块
$env:ELECTRON_RUN_AS_NODE=1 ; & 'E:\DSH Desktop\DSH Desktop.exe' '\dist\index.js' --version
0.1.197 (3aeddc1)
被选中的运行时确实不是 Node:
代码块
where.exe node
C:\Program Files\Microsoft HPC Pack 2019\Bin\node.exe
& 'C:\Program Files\Microsoft HPC Pack 2019\Bin\node.exe' -p process.execPath
Node Commands
Syntax:
node {operator} [options] [arguments]
…(16 行 HPC CLI 帮助)
exit=0
不是代理端口/attach 竞争问题:日志里没有任何 attach 尝试记录,%TEMP%\bili-proxy-18787.log 里没有一行插件输出。
影响 / Impact
压缩完全不生效(全程未压缩直连;本机 bili.log 另有 5 条 proxy not ready 直连告警)。
每 10s 派生一个无关进程 + 追加日志,4 天 6575 次;bili-proxy-18787.log 已 4 MB。
与文档承诺冲突:CONFIGURATION.md / CONFIGURATION.zh-CN.md 第 1710 行写「PATH 搜索 → … → Electron 宿主自身二进制(ELECTRON_RUN_AS_NODE=1,最后手段 —— 因此 deepseek-harness desktop 这类桌面应用零配置即可用)」。本机正好打破这半句:PATH 上一个同名的非 Node 程序就能把 Electron 回退永久屏蔽,且没有任何告警指出"选中的运行时不是 Node"。
用户无法自助恢复:面板//acp 的建议是"改用 bili dsh 启动",但 bili.CMD shim 同样从 PATH 解析 node,在这台机器上 bili 命令本身也跑不起来(同一个坑),建议对用户不可执行。
建议修复 / Suggested fix
probe 必须证明候选是 Node:用 candidate --version 并要求匹配 /^v(\d+).\d+.\d+/(major ≥ 包 engines 下限);probe 失败就 continue 扫下一个 PATH 目录,绝不 return candidate。真 wrapper(npm/Volta shim)--version 也能正常输出,不会误伤 #1887 的 wrapper 解析。
校验 probe 结果形状:-p process.execPath 的返回值必须是存在的绝对路径、且 basename 为 node/node.exe,否则视为无效 probe。
调整顺序:既然承诺"desktop 零配置",Electron 宿主下应把 process.execPath 提到 PATH 扫描之前(至少与 extraDirs 同级优先),PATH 里的同名二进制不该胜过宿主自带运行时。
失败可诊断:proxy child exited before becoming healthy (code 0) 应带上解析到的运行时路径和子进程 stdout/stderr 前若干字节。
降噪:resolveNodeRuntime() 结果可缓存 + 一次 WARN;现在每次重试都会重新解析并派生一个无关进程。
文档补一句:BILLION_CONTEXT_NODE 那行加「PATH 上存在同名非 Node 程序(如 Microsoft HPC Pack 的 node.exe)时需显式指定」。
临时绕过 / Workaround(已验证可用的方向)
设用户环境变量 BILLION_CONTEXT_NODE 指向真 Node(或宿主自己的 Electron 二进制,此时子进程会继承 ELECTRON_RUN_AS_NODE=1)后重启 DSH —— 该覆盖项在 resolveNodeRuntime() 里最先命中且不做 wrapper 探测。
English summary
On Windows, resolveNodeRuntime() (0.1.197) scans PATH before the well-known install dirs and before the Electron fallback, and probeNodeWrapperTarget() treats any non-empty stdout of candidate -p process.execPath as a wrapper target — falling through to return candidate when the probe result is not a path. A non-Node program named node.exe on PATH (here: C:\Program Files\Microsoft HPC Pack 2019\Bin\node.exe, a cluster CLI that ignores -p, prints 16 lines of help and exits 0) is therefore accepted as the proxy runtime: the child exits immediately (proxy child exited before becoming healthy (code 0)), bootstrap retries every 10 s forever (6575 attempts / 4 days), %TEMP%\bili-proxy-18787.log fills with the unrelated program's help text (4,090,894 bytes, zero bili output), and compression never engages. This directly contradicts the documented "desktop apps like deepseek-harness desktop work with zero configuration" guarantee (CONFIGURATION.md L1710), and the advice shown to the user ("launch through bili dsh") is not actionable on such a machine because the bili shims resolve node from PATH too. Probe must validate Node-ness (--version → /^v\d+./, major ≥ engines) and skip failing candidates instead of accepting them; Electron process.execPath should be preferred over PATH; the failure warning should name the resolved runtime and include the child's stdout head.
bili version *
0.1.197 (commit 3aeddc1)
Usage mode *
Plugin native (bili plugin install …, runs inside the host process)
Client and version *
DSH Desktop 2.0.17 (Electron host, profile "web"; dsh-plugin-desktop 2.0.17, host process = DSH Desktop.exe utility/NodeService)
Operating system *
Windows 11 x64 (win32 x64, not WSL2)
Upstream and model *
阿里云百炼 compatible-mode (https://ws-3k…maas.aliyuncs.com/compatible-mode/v1) 与 api.xiaomimimo.com;模型名未出现在直连告警行中
Compression-related config (optional)
# ~/.config/billion-context/ 未改动(默认)
# 仅 profile 侧由插件的 dsh.bundle.patch.yml 生效:
compaction-basic:
auto: falseLog excerpt (strongly recommended)
# ~/.local/state/billion-context/bili.log(4 天,共 6575 次;此处节选首尾各若干行)
2026-10-16T07:50:24.542Z [warn] [v=0.1.197] [dsh-client] proxy bootstrap failed — model traffic goes direct (uncompressed): bili: proxy child exited before becoming healthy (code 0) (log: C:\Users\dell\AppData\Local\Temp\bili-proxy-18787.log)
2026-10-16T07:51:20.416Z [error] [v=0.1.197] [native-client] bili-native: proxy not ready — model request goes direct (uncompressed): https://ws-3k…maas.aliyuncs.com/compatible-mode/v1/chat/completions
2026-10-16T07:55:04.707Z [warn] [v=0.1.197] [dsh-client] proxy bootstrap failed — model traffic goes direct (uncompressed): bili: proxy child exited before becoming healthy (code 0) (log: C:\Users\dell\AppData\Local\Temp\bili-proxy-18787.log)
# 全量消息形态统计(awk 归一化后)
6575 proxy bootstrap failed — model traffic goes direct (uncompressed): bili: proxy child exited before becoming healthy (code 0) (log: …\bili-proxy-18787.log)
4 bili-native: proxy not ready — model request goes direct (uncompressed): https://api.xiaomimimo.com/v1/chat/completions
1 bili-native: proxy not ready — model request goes direct (uncompressed): https://ws-3k…maas.aliyuncs.com/compatible-mode/v1/chat/completions
# %TEMP%\bili-proxy-18787.log —— 4,090,894 bytes,全部内容如下形状(16 行 HPC 帮助,反复重复,无一行 bili 输出)
Node Commands
Syntax:
node {operator} [options] [arguments]
Parameters:
/? or /help - Display this help message.
list - List nodes or node history on the cluster
listcores - List cores on the cluster
view - View properties, history event or allocation history of a node
online - Set nodes to online state
offline - Set one or more nodes to the offline state
setcost - Set the cost of a node
For more information about HPC command-line tools,
see http://go.microsoft.com/fwlink/?LinkId=120724
/acp or acp_status output (optional)
bili: no proxy detected — launch dsh through `bili dsh` so /acp can read context status.
Activity
[-][Windows/dsh][Plugin native] PATH 上的非 Node 程序(Microsoft HPC Pack 的 node.exe)被选为代理运行时 → 子进程秒退、每 10s 重试且永不恢复,与文档承诺的"desktop 零配置"冲突[/-][+][Windows/dsh][Plugin native] Non-Node program on PATH (Microsoft HPC Pack's node.exe) picked as proxy runtime → child exits instantly, retried every 10s forever, contradicting the documented "desktop zero-config" promise | [Windows/dsh][Plugin native] PATH 上的非 Node 程序(Microsoft HPC Pack 的 node.exe)被选为代理运行时 → 子进程秒退、每 10s 重试且永不恢复,与文档承诺的"desktop 零配置"冲突[/+]FZNN-XX commentedon Oct 16, 2026
(ai: deepseek/deepseek-v4.1-flash)
本机已完成定位 + 修复 + 前后验证,补一条结论。为了不复述正文,这里只写新增事实:精确到行的根因、issue 里还没有的实测证据、以及一份可直接
patch -p1应用的建议修复。1. 结论
代理本体、启动参数、加载方式都正常。故障 100% 落在「运行时选择」这一层:
resolveNodeRuntime()对 PATH 候选只以「文件存在」为门槛,于是把非 Node 的同名程序当成了 Node 运行时。这也解释了为什么用户什么都没配错却拿不到压缩 —— 文档承诺的 Electron 兜底在被污染的 PATH 上不可达。2. 根因精确位置(master 源码,非宿主问题)
该逻辑在
src/launcher.ts(不是src/agent/dsh-native.ts,后者是打包后的等价物,grep resolveNodeRuntime src/agent/dsh-native.ts为 0 命中):src/launcher.ts:3821probeNodeWrapperTarget(candidate, env)—— 只跑-p process.execPath,把任何非空 stdout 当成 wrapper 目标路径src/launcher.ts:3847resolveNodeRuntime(execPath, env, platform, existsImpl, electronVersion, probeWrapper)src/launcher.ts:3856if (base === "node" || base === "node.exe") return execPath;src/launcher.ts:3866-3877resolveDiscovered()—— wrapper 探测得不到「另一个存在的路径」时 原样接受候选src/launcher.ts:3903PATH/extraDirs 循环(PATH 在前,extraDirs在后)src/launcher.ts:3911if (existsImpl(candidate)) return resolveDiscovered(candidate);← 唯一门槛src/launcher.ts:3918if (electronVersion && electronVersion.length > 0) return execPath;← 兜底,排在 PATH 扫描之后,永远到不了src/launcher.ts:3919throw new Error("bili: cannot find a Node runtime to spawn the proxy …")两点正文里还没有的关键事实:
node.exe对-p process.execPath和--version都是「打印帮助 +exit 0」,而且 stdout 不是路径 —— 它骗过了「存在性」,但它的输出形态正好可以拿来做身份闸。node.exe文件本身(不是 .cmd/.bat shim),所以probeWrapper的 [Bug] Windows/OpenCode v2: mise Node shim + detached proxy spawn causes persistent visible console despite windowsHide #1887 wrapper 语义在这条路径上根本没有参与判断。3. 实测证据(正文未包含)
where.exe nodeC:\Program Files\Microsoft HPC Pack 2019\Bin\node.exe(机器级 PATH 第 6 项);C:\Program Files\nodejs不存在,无 npmnode.exe -p process.execPathNode Commands …+exit=0(16 行帮助文本)node.exe --versionNode Commands …+exit=0→ 身份闸判为 REJECTED;对照真 Node 输出v24.18.1%TEMP%\bili-proxy-18787.logbili|acp-proxy|listening的行数 0bili.logbili-native: proxy not ready(api.xiaomimimo.com、…maas.aliyuncs.com)0.1.197 (3aeddc16);DSH Desktop2.0.17;Electron44.0.0/ Node24.18.1;Windows10.0.22621反证(代理本体完全正常) —— 用插件自己的
start参数、隔离端口与隔离状态目录,只把运行时换成真正的 Node:修复后现场(同一台机器、同一个插件版本) —— 最后一条失败停在
2026-10-16T08:26:53.884Z,之后:127.0.0.1:18787变为LISTENING(pid 29660)、proxy-origin出现"lane":"dsh"的实例、会话日志变为4. 修复方案
probeNodeVersion(candidate, env):执行candidate --version,只有输出匹配/^v\d+\.\d+\.\d+/才认定是 Node(HPC 那条被拒)。resolveDiscovered()先过身份闸;未通过返回undefined,循环continue到下一个候选;通过后再做 [Bug] Windows/OpenCode v2: mise Node shim + detached proxy spawn causes persistent visible console despite windowsHide #1887 的 wrapper 探测(wrapper shim 的--version会透传真 Node 版本,[Bug] Windows/OpenCode v2: mise Node shim + detached proxy spawn causes persistent visible console despite windowsHide #1887 语义不变)。if (!existsImpl(candidate)) continue; const resolved = …; if (resolved) return resolved;,每跳过一个候选打一条 warn。base === "node"/"node.exe"(普通 CLI)与显式BILLION_CONTEXT_NODE不探测,常规启动成本不变。probeNodeVersion真实二值)。备选(更小 diff,未写入 patch,交 owner 权衡):不新增探测,而是收紧
probeWrapper语义 —— 若-p process.execPath的输出既不是「存在的路径」也不等于候选自身,就判定候选不是 Node 并跳过。代价是改掉 #1887 明确保留的「探测失败 → 回退候选」契约(真 Node 探测超时会误杀),因此我更倾向--version身份闸。属于产品决策、未擅自改的一条:Electron 宿主下把
execPath排到 PATH 之前可以彻底免疫 PATH 污染,但改变了「真 Node 优先」的既有优先级与兜底语义,按 §7.4 需要 owner 拍板。5. 本机临时绕过(已验证生效)
注意:只安装 Node.js 而不设该变量不够 —— PATH 上 HPC 的
node.exe排在前,插件仍会选它。6. 建议修复的 patch(
patch -p1已对 pristine master 干净应用验证,+105/−12,4 + 12 个 hunk)7. 附件(按需贴全)
本机已生成完整证据包,需要的话我按序贴上(均为纯文本,已脱敏:主机名中段、会话 id、
launchToken、用户名都已打码):01-node-candidates.txtwhere.exe node、HPCnode.exe两条探针的完整输出与退出码、闸门判定、真 Node 对照02-path.txt03-bili-log.txt04-port-log.txt05-versions.txt06-isolated-verification.txt07-live-after-fix.txtproxy-origin、forward POST、cache hit)patch 里的
#XXXX是 issue 号占位符,落成 PR 时替换成#3383即可;改动只碰src/launcher.ts+tests/launcher.test.ts,不含 version bump。FZNN-XX commentedon Oct 16, 2026
01-node-candidates.txt
02-path.txt
03-bili-log.txt
04-port-log.txt
05-versions.txt
06-isolated-verification.txt
07-live-after-fix.txt
FZNN-XX commentedon Oct 16, 2026
All the evidence’s been uploaded
FZNN-XX commentedon Oct 16, 2026
All the evidence’s been uploaded
ranxianglei commentedon Oct 16, 2026
(ai: vllm-qwen/qwen3.8-27b)
查重:不重复。 最接近的既有 issue:#1429/#1576(完全找不到 Node 时的 Electron 回退)、#1887/#1888(wrapper shim 控制台窗口)、#3116/#3127(spawn 失败诊断)——没有一个校验候选是不是真 Node,本 bug 的机制(名为 node.exe 的外来程序被原样接受)独立成立。标题已国际化(英文 | 原文)。
修复 PR:**https://github.com/ranxianglei/billion-context/pull/3387**(Closes #3383)。本地 typecheck + launcher 套件 314/314 通过(含 5 个新回归测试),全量回归以 CI 为准。
八问:
node.exe,排在 PATH 里被 bili 误选为代理运行时——子进程打印帮助文本后秒退,dsh-native 每 10s 重试永不恢复(你的 6575 次/4 天),压缩功能永远不生效。node(.exe)且存在的文件都被原样接受;更糟的是 wrapper 探测功能把该程序的任何非空输出都当作「另一个 Node 的路径」,HPC 的帮助文本也被照单全收、不做校验。已核实这两处代码在你报告的 v0.1.197 与当前 master 上完全相同——是机制缺陷,不是版本差异。BILLION_CONTEXT_NODE)依然有效。--version报告标准vX.Y.Z且 major ≥ 20(bili 的 engines 下限),否则跳过并继续扫描下一个目录;wrapper 探测的答案也加形状检查(必须是绝对路径且 basename 为 node/node.exe)。顺带把 spawn 失败消息增强为带上解析出的运行时路径 + 子进程输出头部 200 字符,下次再遇到类似问题不用翻 4MB 日志。你建议里的第 3 条(Electron 优先于 PATH)没有采用:校验落地后外来程序已被挡住,重排反而给禁用 runAsNode fuse 的定制 Electron 构建带来回归风险;第 5 条(全局缓存)同理不需要——修复后首次解析就成功。BILLION_CONTEXT_NODE显式覆盖与 live-node 快速路径行为不变(显式用户选择仍原样尊重、不探测);[Bug] Windows/OpenCode v2: mise Node shim + detached proxy spawn causes persistent visible console despite windowsHide #1887 的 wrapper→真实 Node 跟随行为不变(既有 9 个相关测试断言全部保持成立,仅补了校验 stub);[Bug] Electron 宿主(DSH 桌面版)下 resolveNodeRuntime 找不到 node:代理起不来、5 个工具全丢、会话被撑爆到模型拒答 #1429 的 Electron 回退顺序不变。有意的行为变更(PR 内已完整披露):有效但过旧(< v20)的 Node 现在会被跳过而不是 spawn;失败消息新增运行时路径与子进程输出头部。BILLION_CONTEXT_NODE条目补了一句校验规则说明。ranxianglei commentedon Oct 16, 2026
(ai: vllm-qwen/qwen3.8-27b)
补充:PR #3387 的 CI 已全部跑完——6 个测试分片(ubuntu/windows × node 22/24)+ 全部静态门禁(static-gates、docs-sync、config-surface-guard、version-guard、kernel-guard 等)全绿,0 失败。PR 当前 mergeable,等人工 review 合并即可。合并后此 issue 自动关闭;届时升级新版 bili 即生效,你现有的
BILLION_CONTEXT_NODE临时方案可保留也可移除(显式覆盖始终优先,行为不变)。fix: validate discovered Node candidates via --version before spawnin…
ranxianglei commentedon Oct 16, 2026
(ai: vllm-qwen/qwen3.8-27b)
这份独立定位的结论与本 issue 已提交的修复一致——PR #3387(刚 rebase 到最新 master、CI 重跑中),根因与方向相同(
--version身份闸 + 跳过并继续扫描),不再开第二个 PR。几点确认与说明:你的实测新事实,与既有分析吻合:
node.exe对--version同样是「帮助文本 + exit 0」→ 正是身份闸要拒掉的形态(fix: validate discovered Node candidates via --version before spawning them as proxy runtime (#3383) #3387 的核心机制);C:\Program Files\nodejs不存在、无 npm)→ 升级到修复版后的解析路径 = 跳过 HPC 假节点 → 安装目录无果 → 落到 [Bug] Electron 宿主(DSH 桌面版)下 resolveNodeRuntime 找不到 node:代理起不来、5 个工具全丢、会话被撑爆到模型拒答 #1429 的 Electron 宿主二进制回退(ELECTRON_RUN_AS_NODE=1,即 DSH Desktop.exe 自身当 Node 24.18.1 用)。这正是「desktop 零配置」承诺的恢复;你的临时绕过BILLION_CONTEXT_NODE可留可删——显式覆盖行为不变,结果殊途同归。为什么没有直接采用你的 patch(#3387 是它的超集,差异在顺序与严格度):
probeNodeVersion接受任意vX.Y.Z;fix: validate discovered Node candidates via --version before spawning them as proxy runtime (#3383) #3387 要求 major ≥ 20(package.jsonengines.node >= 20)——否则一个真正过旧的 Node(v16/v18)会通过闸门被 spawn,bili 照样跑不起来;-p process.execPath的任何非空 stdout 当作目标路径;fix: validate discovered Node candidates via --version before spawning them as proxy runtime (#3383) #3387 要求答案必须是绝对路径且 basename 为node(.exe),并且对最终被 spawn 的可执行文件(可能是 wrapper 目标)再做一次--version校验——不变量是「被 spawn 的东西必须自证身份」。你的第 3 条回归测试期望「非 Node 候选不参与 wrapper 探测」,在 fix: validate discovered Node candidates via --version before spawning them as proxy runtime (#3383) #3387 的顺序下不成立(先探测、后验主体)——两种顺序都会拒掉 HPC 候选,fix: validate discovered Node candidates via --version before spawning them as proxy runtime (#3383) #3387 的顺序多覆盖一种「--version过关但-p输出垃圾路径」的情形;你的备选方案(只收紧
probeWrapper语义、不加探测)正是评审时排除的路径:它会改掉 #1887 明确保留的「探测失败 → 回退候选」契约。你留给 owner 拍板的产品决策项(Electron 排到 PATH 之前)也已定:不采用——校验闸落地后外来程序已被挡住,重排反而给禁用 runAsNode fuse 的定制 Electron 构建带来回归风险。如发现 #3387 有具体遗漏的场景,欢迎指出来,会评估补进该 PR(一个 issue 对应一个 PR,不开并列)。
fix: validate discovered Node candidates via --version before spawnin…
ranxianglei commentedon Oct 16, 2026
(ai: vllm-qwen/qwen3.8-27b)
状态更新:PR #3387 已 rebase 到最新 master(f94ee8f1f,含 #3378/#3381/#3332),CI 全绿:19 通过 + 11 条件跳过(均为 env-gated 的真实客户端 e2e 通道,常态)+ 0 失败;本地 typecheck 与 launcher/#2187 定向测试同样全绿(312 pass / 0 fail)。
中间有过一次红,如实说明排查结论:第一次 rebase 后
test (ubuntu-latest, 22, 2)有两个 #2187 慢启动预算断言失败(bound at 26s/45s must not burn the whole budget)。判定与本 PR 变更无关:--version探测与错误消息格式,不参与 tick 计数——机制上不可能影响该断言;src/launcher.ts或 Windows/dsh 宿主重启:代理就绪超出 SPAWN_WAIT_MS(20s) 导致 bootstrap 失败,本进程内无重试 → /bili/origin 恒为 null、设置面板永久"未绑定"、整场会话直连(压缩失效) #2187 测试文件;test (windows-latest, 22, 1)失败——opencode v1: keep opencode-acp legacy sessions working after switching to bili #920 plugin bypass header 下两个子测试cancelledByParent("Promise resolution is still pending but the event loop has already resolved"),同样与本 PR 无关;当前等待人工评审合并(分支保护需要 approval)。
ranxianglei commentedon Oct 16, 2026
(ai: vllm-qwen/qwen3.8-27b)
附件包已核对(01/02/05/06/07 全文读过;03-bili-log 与 04-port-log 是此前已定性的大日志——warn ×6736、端口日志 4MB 帮助文本重复,内容与既有结论一致,未再逐行重读)。全部证据与 PR #3387 的设计吻合,没有发现任何矛盾点:
node.exe(12664 字节)对-p process.execPath和--version返回同一份 16 行 "Node Commands" 帮助且 exit=0 —— 这正是 PR 里probeNodeMajor的/^v(\d+)\.\d+\.\d+/判定会拒绝的输出(你们自己 [C] 段的结论 "gate is correct" 与实现一致);对照真 Node 的v24.18.1能通过。BILLION_CONTEXT_NODE=E:\DSH Desktop\DSH Desktop.exe显式覆盖行为不变,继续有效。ELECTRON_RUN_AS_NODE=1+ DSH Desktop.exe 独立拉起代理成功(健康检查 ~0.5s HTTP 200、完整启动日志、脚本 exit=0)—— 这正是 fix: validate discovered Node candidates via --version before spawning them as proxy runtime (#3383) #3387 修复后默认会走到的那条回退路径的实证。结论:无需任何设计调整。 PR #3387(head 5d6eafc)CI 全绿,等待人工审批合并。升级后建议顺手把用户级的
BILLION_CONTEXT_NODE临时移除验证一次零配置路径(预期:warn 一行跳过 HPC 候选 → Electron 回退接管);若想保持显式钉住也可以不动,两种姿势都支持。ranxianglei commentedon Oct 16, 2026
(ai: vllm-qwen/qwen3.8-27b)
收到,证据包已全部核对完(上一条回复里逐文件列了结论)——全部与修复设计吻合,无矛盾点。当前状态:PR #3387(head 5d6eafc)CI 全绿,等人工审批合并。升级后如想顺手验证零配置路径:临时移除用户级
BILLION_CONTEXT_NODE,预期看到一行 warn(跳过 HPC 假候选)后 Electron 回退接管、18787 正常 LISTENING。有问题随时喊我。ranxianglei commentedon Oct 16, 2026
(ai: vllm-qwen/qwen3.8-27b)
这条与上一条(相隔几秒的重复提交)内容相同,证据已在上条回复里全部核对完毕,结论不变:与 PR #3387 设计吻合、无矛盾点。PR 仍为 open / CI 全绿,等人工审批合并。本 issue 侧无待办。
[-][Windows/dsh][Plugin native] Non-Node program on PATH (Microsoft HPC Pack's node.exe) picked as proxy runtime → child exits instantly, retried every 10s forever, contradicting the documented "desktop zero-config" promise | [Windows/dsh][Plugin native] PATH 上的非 Node 程序(Microsoft HPC Pack 的 node.exe)被选为代理运行时 → 子进程秒退、每 10s 重试且永不恢复,与文档承诺的"desktop 零配置"冲突[/-][+][Windows/dsh][Plugin native] Non-Node program on PATH (node.exe from Microsoft HPC Pack) selected as agent runtime → chi | [Windows/dsh][Plugin native] PATH 上的非 Node 程序(Microsoft HPC Pack 的 node.exe)被选为代理运行时 → 子进程秒退、每 10s 重试且永不恢复,与文档承诺的"desktop 零配置"冲突[/+]ranxianglei commentedon Oct 18, 2026
(ai: vllm-qwen/qwen3.8-27b)
同一缺陷的第二个现场实例今天到了(#3655,@Dog,Windows / dsh plugin native / bili 0.1.199),确认了本 issue 的「真但过旧」变体 —— 已按重复关闭并入本线程。补充本票还没有的事实:
D:\node\node.exe),不是冒牌程序。子进程死法:ReferenceError: File is not defined(dist/index.js 内联的undici/lib/web/webidl/index.js),exit code 1;该机器无其他 Node、无BILLION_CONTEXT_NODE。File全局(仅 Node ≥ 20 存在),与 package.jsonengines.node >= 20恰好一致。正是本 PR 的MIN_PROXY_NODE_MAJOR = 20闸 + 「a valid Node below the engines floor is rejected」回归测试所覆盖的场景。BILLION_CONTEXT_NODE(指 DSH Desktop exe 或真 Node ≥ 20)。PR 本身无需改动;此实例进一步支持尽快合并。
Merge pull request #3387 from ranxianglei/2026-10-16_node-runtime-val…
fix(launcher): reject Electron-as-node shims named node during runtim…