Skip to content

[PR] fix: Misc lane minor fixes, Part 4 — hermes plain-http proxy routing + acp_status occupancy anchor | fix: 其他车道小修合集第四辑 —— hermes plain-http 代理路由 + acp_status 占用锚点 - #5987

Open
ranxianglei wants to merge 3 commits into
masterfrom
2026-11-09_other-lane-small-fixes-batch
Open

ranxianglei wants to merge 3 commits into
masterfrom
2026-11-09_other-lane-small-fixes-batch

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

两个已评审小修合并送审(一 PR 一合)

来源 PR 内容 作者 关闭 issue
#5121 hermes 启动器:plain-http provider 按协议分流进代理(HTTPS_PROXY(https)+ HTTP_PROXY(plain-http)+ NO_PROXY 回环直连),此前只有 HTTPS_PROXY,plain-http provider 对 bili 不可见 ranxianglei #5116
#5023 acp_status 输出上下文占用锚点(used/window),agent 不再把终身累计 "original" 当当前上下文读 Augenblick0v0(外部贡献者) #5021

贡献者身份保留

#5023 用 cherry-pick 原提交 898954f8 合入,git author 保留为 Augenblick0v0 <caiyanhong35@gmail.com>;squash 合并后作者身份仍在合并历史里。

冲突处理(合入 master ec4b9f7 时)

预检(本地,2026-11-10)

  • npm run build OK,tsc --noEmit 0 错
  • 目标套件 384/384(launcher / issue5021-context-occupancy-anchor / acp-status ×4)

Closes #5116
Closes #5021

ranxianglei and others added 2 commits November 9, 2026 09:08
#5121, closes #5116)

Doc hunks retargeted to the post-docs-centralization locations:
CLIENTS.md -> docs/clients.md, CONFIGURATION.md -> docs/configuration.md
(master replaced both with redirect stubs after this PR's base).
… lifetime "original" total as current context (#5021)

acp_status gave an absolute `BILLED INPUT … tok` with no denominator, and the kernel's
`COMPRESSED BLOCKS — N active (X summary, Y original)` header prints a LIFETIME reclaimed
total one line above it. An agent that cannot see the route's window has no anchor, so
both figures read as current occupancy.

Measured incident: a session at 116,902 of a 1,000,000-token window (11.7%, peak 16.9%)
reported "the context is exhausted" to its user and stopped mid-task, citing the
1,214.1K lifetime original and the 4.3K remaining foldable mass as its evidence.

The report now always carries the missing denominator when a billed sample exists:
  CONTEXT: 116902 / 800000 tok used (14.6%) · 683098 tok remaining of the input budget
Guarded: no billed anchor or a non-positive limit prints no line, and remaining clamps
at 0 so an over-limit reading never shows a negative budget.
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-09_other-lane-small-fixes-batch (c135d08)

Latest build — install this exact version

npm install -g billion-context@0.0.8718-pr.5987.a2454f9

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
c135d08 billion-context@0.0.8718-pr.5987.a2454f9 build
055228e billion-context@0.0.8708-pr.5987.5310ac4 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5987.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix: 其他车道小修合集第四辑 —— hermes plain-http 代理路由 + acp_status 占用锚点 [PR] fix: Misc lane minor fixes, Part 4 — hermes plain-http proxy routing + acp_status occupancy anchor | fix: 其他车道小修合集第四辑 —— hermes plain-http 代理路由 + acp_status 占用锚点 Nov 9, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
(ai: vllm/qwen3.8-27b)

查重: 不重复。 已列出全部 open [PR] 行逐一比对:没有第二个 PR 指向 #5116(hermes plain-http 路由)或 #5021(acp_status 占用锚点);本 PR 是这两个已评审小修的唯一送审载体(cherry-pick 898954f8 保留外部作者 Augenblick0v0 的 git authorship,已用 git log 核实)。

标签: bug + hermes + scope/kernel + p2(理由:两处均为缺陷修复;涉及 hermes 车道与上下文管理面;plain-http hermes provider 在特定条件下完全收不到压缩,属"能用但有明显问题/需绕行"档,故 p2)。

独立审核进行中(方向关 → 回归清点 → 代码 → 测试有效性 → diff 整洁度),跑完定向测试与 CI 状态核对后按八问体例给结论。

@ranxianglei ranxianglei added bug Something isn't working hermes 改动范围:内核之外的主机侧接线(src/agent 适配器、server 路由、注入拦截)/范围兜底/客户端标签 p2 scope/kernel labels Nov 9, 2026
…hips it (#5116)

Review fix on this branch: the plugin-lane sentence claimed HTTP_PROXY /
NO_PROXY routing that this PR does not ship for the native plugin. The
plugin's apply_env still sets only the HTTPS pair + CA bundles; the plain-http
half lives in open PR #5117 (adds the HTTP pair + NO_PROXY setdefault to
apply_env). Reword so each claim matches code on master: the launcher lane
(this PR) routes both schemes; the plugin lane gets them via #5117.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
(ai: vllm/qwen3.8-27b)

审核完成:可合入(新 head c135d08 CI 全绿)。审核中发现一处文档超前于代码的表述,已直接修掉(详见下)。

审核中顺手修(新增 commit c135d08,已推本 PR 分支)

docs/clients.md 的 Hermes 段原称原生插件车道也做 HTTP_PROXY/http_proxy + NO_PROXY(defaulted when the user hasn't set one)的按协议分流——但本 PR 只改了 src/launcher.ts(launcher 车道);插件侧 apply_env(hermes-plugin/init.py)现在只设 HTTPS 对 + CA bundle,plain-http 那半在未合的 #5117 里。只合本 PR 的话文档会领先代码。已把该段改写为按车道归属:launcher 车道已支持两协议,插件车道随 #5117 到位(留了出处行,#5117 合后清理一行即可)。推送后 CI 重跑全绿。

结构化八问

1. 是什么问题:两个独立小修合并送审——① hermes 启动器只设 HTTPS_PROXY,plain-http provider(LAN llama.cpp/vLLM 等)完全绕过 bili、拿不到压缩;② acp_status 没有分母锚点,agent 把终身累计 "original" 误读为当前上下文占用,真实事故中在 11.7% 占用时宣布"上下文用尽"并停工。

2. 什么原因导致的:① hermes 的 httpx 按协议解析代理环境变量,HTTPS_PROXY 覆盖不到 http;服务端自 #535 phase 2 起就支持 absolute-form 转发,客户端 env 接线缺了一环;② acp_status 只输出 BILLED INPUT 绝对值,从不输出 config.modelContextLimit,PRESSURE NOTE 在 60% 以下静默,判断无锚可依。

3. 影响范围与严重程度:① bili hermes × plain-http base_url 的用户完全不受压缩影响;https 路径与其他车道不受影响 → p2;② 任何读 acp_status 的 ACP 会话都有低占用误判风险,已发生一次生产事故 → p2。均不涉及数据丢失或缓存泄露。

4. 怎么修复的:① hermes spawn 路径补 HTTP_PROXY=origin + NO_PROXY/no_proxy 回环常量(与其他 env-routing 车道同模式),回环保持直连;② billed>0 && modelContextLimit>0 时加一行 CONTEXT: used / limit tok used (pct%) · remaining tok remaining of the input budget,分母取逐请求 resolveRequestConfig 解析后的有效输入预算(含 output-headroom 扣减),已核对全部 forward() 路径传的都是 reqConfig。

5. 是否有回归问题:逐项清点既有行为——

  • hermes 子进程 env 基线:先 stripInheritedProxy 剥继承代理变量再写常量,与 jcode/zed/kiro/qwen/aider 车道既有行为一致;用户自设 NO_PROXY 在 hermes 子进程内被常量覆盖(其余五车道同样行为,非新回归类);
  • 披露的行为变更(旧→新):hermes 子进程的非模型 plain-http 出站流量现在开始走 bili(此前直连、对 bili 不可见)——[bug][plugin] hermes native lane never routes a plain-http provider base_url (only HTTPS_PROXY is set) #5116 场景(LAN http provider)正是目标;服务端准入 checkTunnelDestination 对回环客户端放行私有地址、拒绝自代理/link-local/metadata、公网正常转发 = 既有捕获姿态的延伸,不是破坏;
  • acp_status 纯增量行:上游从不报 usage 时无行(fail-closed,不虚构占用);modelContextLimit<=0 不出行、无 NaN;超限 remaining 钳 0;
  • 一处既有小瑕疵(非本 PR 引入,不在范围):cycle-stale 时 statusInputBaseline 回落本地估算,BILLED 行标签仍写 "upstream usage",CONTEXT 行继承与 BILLED 相同的数/口径;
  • 文档修复 commit 只动 clients.md 一段,无代码。

6. 是否破坏缓存:不涉及。不触碰缓存/重试/增量游标/去重键;CONTEXT 行只是工具输出文本的一行增量。

7. 是否改了设计方向:无转向。① hermes 车道对齐全舰队"env 路由 + 回环直连"惯例(i18n note 自 9/27 起就承诺 "http absolute-form forwarding",本次让现实匹配已文档化的契约);② acp_status 增加观测锚点,不改压缩决策管线。已知残留:#5021 验收项 2(kernel 报告头 COMPRESSED BLOCKS … original 累计量加"已回收、不计入当前请求"标注)属 kernel 变更(human-gated),外部作者明确未纳入本 PR——建议 owner 决定是否另立 kernel follow-up。

8. 是否引入了新的配置:无。无新 env/config/knob;NO_PROXY 常量是既有的 LAUNCHER_LOOPBACK_NO_PROXY。

验证证据

  • 本地定向:kernel+pi-subagents build OK;tsc --noEmit 0 错;511 个定向测试(launcher / 新增 4 case / acp-status 系列 / 全部消费 BILLED INPUT 的文件)→ 510 pass、1 skip(平台门控用例,与本 diff 无关)
  • CI(新 head c135d08,live 核对):主 CI CORE 矩阵(ubuntu 22/24 + windows 22,11 个 test shard 覆盖全部文件 + 静态腿)success;全部 e2e 车道(codex persona / pi-ws / dsh / fake-codex / native-pi / registry / Windows codex overlay / build artifact)success;PR state=open,mergeable_state=behind(master 前进了,不构成阻塞)
  • 作者身份:git log 确认 cherry-pick 提交 author = Augenblick0v0 caiyanhong35@gmail.com,外部贡献者身份保留 ✓

协调备注(供 owner 参考,我不动手)

结论:可合入。 两个修复各自闭环,CI 在 pushed head 上全绿,唯一文档漂移已当场修复。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working hermes 改动范围:内核之外的主机侧接线(src/agent 适配器、server 路由、注入拦截)/范围兜底/客户端标签 p2 scope/kernel 马上合并

Projects

None yet

2 participants