Repository navigation
[PR] fix(hermes launcher): route plain-http providers through the proxy (#5116) - #5121
ranxianglei wants to merge 2 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.8302-pr.5121.442ed89This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5121.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重结论(前置):本 PR #5121 与在途外部 PR #5117(elight,更早 07:55Z,仅 native/plugin 车道)属同机制同症状家族——都是给 hermes 补
对 #5121 的结构化八问审查
测试有效性:断言有牙——attach 场景钉住 CI(镜像缓存读一次):30 checks,failed 0;9 个 test shard 仍在跑(ubuntu/windows × node22/24),static-gates / mysql-contract / docs-coverage / test-import-graph / plan / unused-exports / pi-subagents-guard 全绿。等 test shard 收尾再下最终绿判,不轮询 gh。 需要你拍板:合哪个 PR?
我的建议:A。理由:#5121 是 #5117 的超集,「loopback 恒直连」语义与兄弟车道一致、更稳,且把 launcher 的同款隐患一并堵上。但 elight 是 #5116 的报告者兼外部贡献者——合 A 时请在描述里保留其字段证据注记(「已在 Hermes v0.22.5 主机自 2026-10-25 运行等价改动」),别让它白做。 我不关闭任何条目、不动 PR 正文引用,等你的方向。定了我再改引用 / 并证据注记。 |
(ai: vllm-qwen/qwen3.8-27b) Synced: merged origin/master@491ac1ded into the branch (merge commit e937664, clean, zero conflicts — only doc files overlapped; hermes env block in src/launcher.ts verified intact), pushed — PR is no longer behind (base == master tip, mergeable=true), fresh CI run queued on e937664; expected reds are the known #4599 inherited lanes only (ci-fixes already contained in master). |
…5116) Companion to PR #5117 (reporter's fork PR), which fixes the same mechanism in the native plugin lane and stays there untouched — this branch is a fork, so this PR covers only the complementary part: the 'bili hermes' LAUNCHER lane + docs + launcher test. hermes' httpx stack resolves proxy envs per scheme (field-verified on Hermes v0.22.5): https upstreams read HTTPS_PROXY, plain-http upstreams read HTTP_PROXY. The launcher exported only the HTTPS pair, so plain-http providers went straight out and bili never saw them (#5116). Same defect class as the plugin lane; same fix shape as the dsh/kimi/mcode/jcode/zed/ qwen house pattern (HTTP_PROXY = origin + loopback NO_PROXY). The child env is stripped of inherited proxy vars first, so the static loopback constant is the whole NO_PROXY value here. Behavior changes (disclosed per policy): - plain-http provider traffic: direct to server -> routed through bili (absolute-form forward-proxy requests) — the intended fix. - child env gains HTTP_PROXY/http_proxy=<origin> and NO_PROXY/no_proxy=localhost,127.0.0.1,::1. - loopback https providers now go DIRECT instead of CONNECT-MITM'd through bili — consistent with the loopback-direct contract every other env-routing lane already keeps for its own proxy origin. - non-model http egress of the spawned hermes process rides bili instead of going direct. Together with #5117 this completes #5116; the two PRs touch disjoint files and merge cleanly in either order.
e937664 to
23a255f
Compare
|
(ai: vllm-qwen/qwen3.8-27b) Re-scope note: after pushing the original both-lanes version I discovered the reporter had opened PR #5117 covering the plugin lane (fork branch — not pushable into). Per first-filed-wins, #5117 keeps the plugin lane; this PR was re-based onto current master and re-scoped to the complementary launcher lane + docs + launcher test (commit 23a255f, force-pushed to the same branch). Files are disjoint between the two PRs; merge in either order. |
(ai: vllm-qwen/qwen3.8-27b) 本轮处理完成:5 个红分片全部为继承性/瞬态签名,与本 PR 的 diff 零因果;分支已同步当前 master 并推送(新头
现状:镜像缓存已看到新头 |
(ai: vllm-qwen/qwen3.8-27b) 本轮处理完成:唯一红分片是已登记的瞬态竞态家族签名,与本 PR 零因果;零代码改动,已触发该分片重跑。
现状:重跑已被 GitHub 接受(镜像缓存尚未刷新到新的运行态);分片约 8 分钟出结果。若重跑仍红会再次触发本车道。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
APPROVE — 独立审完收窄后的最终 diff(head 54da25e3a,base = master tip bfabcd1ca,无 behind)。
查重:不重复。本 PR(launcher 车道)与 #5117(plugin 车道,外部贡献者 fork)同修 #5116,但机制互补、文件不相交;按 owner 指示的分工,文档整体随本 PR 走(#5117 只含插件代码 + 测试),两 PR 任意顺序合并均可。
方向关(原 issue):#5116 根因是 hermes 的 httpx 栈按 scheme 分解析代理环境变量(http:// 目标只读 HTTP_PROXY,从不回退 HTTPS_PROXY;报告人已在 Hermes v0.22.5 实测)。两条 hermes 车道都只导出了 HTTPS 对 → plain-http provider(LAN llama.cpp/vLLM/OpenAI-compatible gateway)直连出网,bili 完全不可见(插件报 ready、零压缩、acp_status 空)。修法打在源头(launcher spawn env 注入正确的 per-scheme 变量),不是症状层拦截——方向正确。
回归审查(逐项既有行为):
- https provider 的 CONNECT + cert-MITM 路径:不变(
HTTPS_PROXY原样保留); - CA 信任(
SSL_CERT_FILE→ combined bundle + legacyHERMES_CA_BUNDLE):不变; - 无 provider 时打印警告、hermes 裸跑:判定逻辑未动;
- 继承代理变量剥离:核实
stripInheritedProxy的INHERITED_PROXY_VARS(src/launcher.ts:4495)覆盖全部 8 个大小写变体含NO_PROXY/no_proxy,新注释「env 已被剥离,静态常量即全值」成立; - 其余所有车道(pi/opencode/dsh/codex/claude/kimi/…):diff 未触碰;
- 无
kernel/、无配置面变更、无版本行、无 lockfile 漂移。
行为变更(有意,PR 描述已披露,逐条对照代码确认真实):
- plain-http provider 流量:直连且对 bili 不可见 → 经
HTTP_PROXYabsolute-form 转发进入 bili(本修复本体); - hermes 子进程
NO_PROXY/no_proxy:bili 原先不设 → 设为localhost,127.0.0.1,::1(复用既有常量LAUNCHER_LOOPBACK_NO_PROXY,src/launcher.ts:1020,与 jcode/aider/kiro/zed/qwen 五车道同一契约); - 推论:loopback 上的 https provider 从 CONNECT-MITM(可压缩)变为直连(不压缩) —— 与各兄弟车道的 loopback 直通契约一致,属跨车道对齐而非破坏;
- hermes 进程的非模型 http 出站:直连 → 随
HTTP_PROXY进入 bili(未知端点原样转发),与此前HTTPS_PROXY的暴露面完全对称。
代码审查:净改动 = 3 行 env 注入 + 一段注释更正(旧注释「单一变量服务两个 scheme」与实测不符)+ 3 条测试断言 + 3 处文档。断言有牙:HTTP_PROXY === HTTPS_PROXY 钉住同源路由;NO_PROXY/no_proxy 逐字钉住常量值,常量若漂移或注入丢失都会被抓住。大写-only 写法与该车道既有的 HTTPS_PROXY 模式一致(继承变量先剥离,不存在小写遮蔽)。CI:镜像缓存确认该 head 30/30 check 通过(0 failed / 0 pending)。
一个非阻塞观察:CLIENTS.md 改动的段落属于 hermes plugin 车道描述(HTTP_PROXY + NO_PROXY setdefault 语义),对应代码在 #5117 —— 若本 PR 先合入,该段在 #5117 落地前会短暂领先于 master 代码。这是 owner 指示的文档分工所致(fork 分支无法代推),记录在案,不构成阻塞。
八问:
- 是什么问题:hermes 配置 plain-http base_url 的 provider(局域网自建模型等)流量绕过 bili,压缩静默失效且全程无报错。
- 什么原因导致的:httpx 按 scheme 解析代理变量,plain-http 只认
HTTP_PROXY;两条 hermes 车道都只导出了 HTTPS 对——是变量缺失,不是配置错误,所以用户侧无从自查。 - 影响范围与严重程度:仅限 hermes 车道且配置了 plain-http provider 的用户;该场景下压缩完全失效(核心承诺失灵),https provider 用户不受影响。
- 怎么修复的:launcher 出口按 scheme 补齐
HTTP_PROXY(与HTTPS_PROXY同 origin),并用既有 loopback 常量设NO_PROXY/no_proxy保本地端点直通——复用五兄弟车道的同一契约,不引入新机制。 - 是否有回归问题:无。上述既有行为逐项核对均保持;唯一实质变化是 loopback https provider 失去 MITM 压缩(旧值:CONNECT-MITM 可压缩 → 新值:直连不压缩),属跨车道契约对齐且已披露。
- 是否破坏缓存:不涉及(不改任何缓存/重试/游标逻辑,只改变哪些流量能到达 bili)。
- 是否改了设计方向:不涉及(沿用既有 proxy-env 车道范式)。
- 是否引入了新的配置:不涉及(无新 env/config/默认值;
NO_PROXY是子进程内部变量,非用户配置面)。
结论:可合并。
(ai: vllm-qwen/qwen3.8-27b) ✅ review 完成:PR #5121(head 54da25e)判定 APPROVE / 可合并——独立审完收窄后 diff(launcher 车道 3 行 env 注入 + 注释更正 + 3 条断言 + 3 处文档),回归逐项核对无破坏,行为变更(plain-http 进代理 / NO_PROXY loopback / loopback https 失去 MITM)均与 PR 披露一致且属跨车道契约对齐;CI 镜像缓存确认该 head 30/30 check 通过。GitHub 已发正式 review(COMMENT 事件,因同一账号不能 approve 自己的 PR;review 内含完整八问结论)。无需顺手修项。等 owner 合并。 |
|
(ai: sglang-gpu0/qwen3.8-27b) 已送审合入: 本 PR 的改动经「其他车道小修合集第四辑」#5987 送审(文档 hunk 因 master 文档集中化重投到 docs/clients.md + docs/configuration.md)。本 PR 关闭以免重复。 |
#5116 has two home lanes. The native plugin lane (attach) is fixed by the reporter's PR #5117 (fork branch — I can't push into it, so it stays as-is); this PR covers the complementary launcher lane (
bili hermes) + docs + launcher test. The two touch disjoint files and merge cleanly in either order.What changed
src/launcher.ts(hermes branch): exportsenv.HTTP_PROXY = originalongside the existingHTTPS_PROXY, plusNO_PROXY/no_proxy = localhost,127.0.0.1,::1; corrects the stale comment claiming hermes resolves ONE proxy env var for both schemes.tests/launcher.test.ts: four new assertions pinning per-scheme env routing in the hermes child.Why this shape: hermes' httpx resolves proxy envs PER SCHEME (field-verified on Hermes v0.22.5) — https reads HTTPS_PROXY, plain-http reads HTTP_PROXY; HTTPS_PROXY alone left plain-http providers going straight out (#5116). Same fix shape as the dsh/kimi/mcode/jcode/zed/qwen house pattern. The child env is stripped of inherited proxy vars first (
stripInheritedProxy), so the static loopback constant IS the whole NO_PROXY value here.Behavior changes (old → new)
HTTP_PROXY=,NO_PROXY/no_proxy=localhost,127.0.0.1,::1Verification
node --import tsx --test tests/launcher.test.ts→ 352/352 pass (incl. the new assertions);npm run typecheckclean; full-suite verdict = remote CI on this headCloses #5116 (together with #5117, which owns the plugin lane)