Skip to content

[Hermes lane] Disable Hermes' native auto-compaction during plugin setup, and surface host-native compaction landings as an explicit marker #4458

Closed

Description

@MojitoJoe1813

Source: reading of v0.1.205 (e518363) against v0.1.204 (182 commits, 166 files) on a live Hermes
forward-lane rig. Related issues: #2849, #4168, #2728 (Claude Code), #2372 (Codex), #3451/#1777/#3820/#2193
(dsh), #454 (omp), #1382 (Pi), #2415 (TRAE), #1212, #2219.

The gap

Every other host with a bili plugin lane gets its host-native auto-compaction switched off by the
installer
; Hermes is the only one where nothing is written:

Consequence: on Hermes lanes two compressors coexist by default. When the host lands a forced compaction
mid-session and the model then switches, the kernel ref space goes stale; we reproduced the hard end of that
on v0.1.202 — after a preflight truncation the model switched, then called compress against a dead range
with an over-wide span, every follow-up call died on range validation, and the session was unusable from the
first message ("[Message truncated]"). We pinned it to host-native compaction (model-switch generation change
leaving a stale fold ledger — same shape as #4038) and had to disable the host compressor by hand to keep the
lane usable. That manual step is now the reason this rig runs the lane at all.

What we ask for

  1. Setup writes the Hermes disable (parity with opencode/claude/dsh): when the installer wires Hermes in,
    write compression.auto: false to the Hermes config the installer already reads/writes — including the
    profile copy when the session runs under a named profile — and warn at boot if it could not latch
    (same pattern as [PR] fix: alarm loudly when the dsh compaction-disable overlay cannot latch (#3806) #3820). Document the Hermes recipe like [PR] docs: tighten the dsh compaction-off recipe (disabled: true + all three presets) #3294 did for dsh.
  2. Emit an explicit host-native-compaction marker. v0.1.205 detects and describes these landings well —
    structural finding (src/stream.ts:357), fold-pause on total swap (src/fold-reconcile.ts:2004),
    session metadata nativeCompactionAt / nativeCompactionBoundary (src/session.ts:1349-1355), conflict
    watcher (src/conflict-watch.ts:59), the web hint "keep exactly one compressor"
    (src/web/client.ts:207). None of it reaches acp_status as a queryable per-session flag. Please add one
    (e.g. hostNativeCompression: {at, boundary, hostLane}) so an operator/agent can tell "the host compacted
    under bili" from "bili folded", before the next call burns against a dead ref.
  3. Add the Hermes row to the per-client remediation hints (feat: add per-client remediation hints to compression-conflict surfaces (web banner / acp_status) #2219 closed with hints per client; Hermes has
    no row in that surface today).

Evidence anchors

Version reading at tag v0.1.205 commit e518363: grep for a native-compaction marker name in src/,
kernel/src/, hermes-plugin/ -> 0 hits; the disable switches above exist for opencode/claude/dsh only.
Rig facts: forward-lane via OpenAI-compatible endpoint, Hermes Python plugin, host auto-compaction enabled by
default; failure transcript and fold-ledger state captured 2026-10-21 on v0.1.202.

Activity

  1. MojitoJoe1813 commented on Oct 23, 2026

    @MojitoJoe1813
    Author

    Requested labels (our account has no label permission on this repo): bug, hermes.

  2. ranxianglei commented on Oct 23, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

    (ai: vllm-qwen/qwen3.8-27b)

    TL;DR (for the reporter): Verified against current master (v0.1.205, e518363). You're right on both counts — hermes is the only plugin lane whose installer never disables the host's native auto-compaction, and the detection machinery already records native-compaction landings but never exposes them as a queryable acp_status flag. Two things I need before implementing: (1) your exact hermes config key + hermes version + whether hermes lets a plugin flip compaction off at runtime (you set it by hand, so you know the precise key); (2) the owner's call on where the disable lives (options below). Full analysis in the project's structured form after this.

    查重: 不重复。hermes 是「setup 阶段关掉宿主原生自动压缩」这个家族里唯一漏掉的车道:opencode(installer 写 compaction.auto=false)、claude(DISABLE_AUTO_COMPACT=1)、dsh(in-package overlay + load-time latch + #3820 报警)、omp(#454)/pi(#1382) launcher 都关了,只有 hermes 的 install 分支(src/plugin-install.ts:1814 hermesInstallCore)只拷 Python 插件文件 + hermes plugins enable,完全不碰压缩配置。同家族相关但不重复(客户端/机制各异):claude #2849/#4168、dsh #3294/#3712、pi #1382、omp #454;你复现的死 ref 砖化与 #4038/#2372「宿主原生压缩落在 bili 视野外 → ref space 变 stale」同形状。现有 hermes open issue(#4282 更新不刷 Python 副本、#2714 ephemeral port、#3442 sub-lane)机制都不同。

    标签: bug hermes p1 scope/wiring(缺陷类:默认双压缩器致长会话砖化;p1=会话不可恢复类,虽有手动绕行;主修点在 install/接入车道)。已在镜像打上。

    我验证了什么(审核三步):

    1. 查证:parity gap 属实(见上)。另确认一个关键边界:src/plugin-install.ts:1773 注释明写 "hermes owns config.yaml, we never parse it" —— 但这只约束 installer(Node 侧);运行时 Python 插件本身早就在读 ~/.hermes/config.yaml(hermes-plugin/__init__.py:569 mitm_domains_from_config、:639 _provider_base_url),甚至 import 宿主模块(:768 hermes_cli.config_providers)。所以「不解析 config.yaml」不覆盖 runtime 插件 —— 这直接扩大了 fix: keep system prompt byte-stable for prefix cache #1 的方案空间(选项 B 就靠这点)。
    2. 层次:你复现的硬故障(model switch 后对死 range 调 compress → 后续全挂、"[Message truncated]")是现象。根因链:hermes 默认双压缩器并存 → 宿主中途落 native compaction → model switch 令 fold ledger/ref space 变 stale → compress 打到死 range → 会话砖化。真正的病因是「没关宿主自动压缩」+「没有可见性」,不是 stream/reconcile 哪一行。修 disable = 恢复单压缩器不变量(与所有车道对齐);加 marker = 让残余风险在下次调用烧到死 ref 前可见。
    3. 方案:方向对;fix: keep system prompt byte-stable for prefix cache #1 有两个硬前置(见待决清单),fix: address all code review findings (condense, routing, session-id, dead code) #2/Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3 基本可直接做。

    结构化八问

    1. 是什么问题:hermes 是唯一一个 setup 不关宿主原生自动压缩的车道 → 默认双压缩器;且宿主落 native compaction 这件事在 acp_status 里没有可查询标志,operator/agent 赶在下次调用烧到死 ref 前认不出来。
    2. 什么原因导致:(a) 各车道补 parity 时 hermes 被漏(installer 只拷文件+enable,且 installer 层刻意不碰 config.yaml);(b) 检测机制本已存在(nativeCompactionAt src/session.ts:1349、nativeCompactionBoundary src/session.ts:1353-1384、rebaseNote src/stream.ts:432、conflict-watch src/conflict-watch.ts:59),但只喂给 conflict 告警和 log,没提升为 acp_status 可查询的 per-session 状态。
    3. 影响范围与严重程度(按选项):
    4. 怎么修复的(推荐思路):fix: keep system prompt byte-stable for prefix cache #1 走 B(能走宿主 API 就不落文件,否则 load 时 merge-write+备份+报警);fix: address all code review findings (condense, routing, session-id, dead code) #2 把既有 metadata 提升为 acp_status 增量字段 {at, boundary, hostLane}(hostLane 复用 src/acp-status.ts:400 已有的 resolved-client);Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3 依 fix: keep system prompt byte-stable for prefix cache #1 定论补 Hermes hint 行(src/conflict-watch.ts:125+ per-client 表 + src/web/i18n.ts)。三者同属「宿主原生压缩处理」一个机制族 → 一个 PR 闭环,不拆片。
    5. 是否有回归(按选项):
      • A:installer 新增对 config.yaml 的写路径 → 必须 merge-preserving + .bili-bak + remove 还原,否则会吞用户其它 hermes 配置(红线:绝不静默改用户配置)。不动两种压缩模式的 wire 语义。
      • B:插件 load 路径新增行为 → latch 失败必须 fail-open(不能因读写 hermes config 异常而阻断 hermes 启动或 model traffic);纯 host-side 开关 + 观测,不影响两种压缩模式。
      • fix: address all code review findings (condense, routing, session-id, dead code) #2:acp_status 输出加字段 → 需过 golden snapshot;不改任何既有字段;两种模式都要出(数据两者都有)。
    6. 是否破坏缓存:否。三者都不动前缀缓存 / fold 判定 / 去重键;fix: address all code review findings (condense, routing, session-id, dead code) #2 仅展示面新增字段。
    7. 是否改了设计方向:fix: keep system prompt byte-stable for prefix cache #1 若走 B,是把「宿主原生压缩治理」从 installer 挪到 runtime 插件(与 dsh [PR] fix: alarm loudly when the dsh compaction-disable overlay cannot latch (#3806) #3820 同向),不改整体架构;走 A 则是扩 installer 的 host-config 写入面(与 opencode/claude 同向)。fix: address all code review findings (condense, routing, session-id, dead code) #2/Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3 纯增量,不改方向。
    8. 是否引入新配置:不引入 bili 侧新 config/env。fix: keep system prompt byte-stable for prefix cache #1 写的是 hermes 自己的 config(compression.auto),不是 bili 配置面;fix: address all code review findings (condense, routing, session-id, dead code) #2 是 acp_status 输出字段(非配置);B 若走宿主 API 连文件都不写。

    选项对比(针对 #1)

    A: installer surgical write B: runtime 插件 latch(推荐)
    层 Node installer Python 插件 load-time
    对齐先例 opencode / claude dsh #3820
    保住 installer「never parse config.yaml」 ✗ 打破 ✓ 保住
    #3820 式 boot 报警(你明确要的) ✗ 无 ✓ 有
    config 被重置后自愈 仅重装时 每次启动
    硬前提 hermes config key path hermes 运行时改压缩设置的能力(API 或落文件)
    主要风险 config clobber(bak 缓解) 依赖宿主能力;须 fail-open

    待决清单(卡在这三点,都不是我能单方拍的)

    1. 核实 hermes 精确 key + 版本 + 能否运行时关:你手动设过,请给确切 key path(是顶层 compression.auto: false 吗?还是别的层级?)、你的 hermes 版本、以及 hermes 是否提供插件在运行时改压缩设置的入口。或 owner 让我去翻 hermes 源码确认。写错 key = 静默 no-op,所以这条是 fix: keep system prompt byte-stable for prefix cache #1 的硬前置。
    2. owner 拍板 fix: keep system prompt byte-stable for prefix cache #1 放哪一层:我推荐 B(保住既有边界 + 直接满足你的 [PR] fix: alarm loudly when the dsh compaction-disable overlay cannot latch (#3806) #3820 报警诉求 + 每次启动自愈),A 作 B 不可行时的回退。
    3. 顺带确认 fix: address all code review findings (condense, routing, session-id, dead code) #2 范围:nativeCompaction* 不止 hermes——Google/Responses/Anthropic/OpenAI prepare 路径 + relay 都会设它(已核实调用点),所以 marker 会是全车道通用观测字段。我建议做成全车道(更值)而非 hermes-only,确认一下?

    这三点一定,我就开一个 PR 把 #1+#2+#3 一起做完(一个 issue 一个 PR 闭环)。当前不动代码。

  3. added
    bugSomething isn't working
    hermes改动范围:内核之外的主机侧接线(src/agent 适配器、server 路由、注入拦截)/范围兜底/客户端标签
    on Oct 23, 2026
  4. MojitoJoe1813 commented on Oct 23, 2026

    @MojitoJoe1813
    Author

    Thanks — verified answers for your pending list. Rig Hermes version: Agent v0.22.3 (2026.9.24), local build 5b147ab036d6.

    (1) Exact key. Hermes has no compression.auto key. The master switch is top-level compression.enabled — documented at https://hermes-agent.nousresearch.com/docs/developer-guide/context-compression-and-caching#configuration ("enabled: true # Enable/disable compression (default: true)"), seeded in hermes_cli/config_defaults.py:592ff, and present in our live ~/.hermes/config.yaml line 142 (enabled: true). Verified consumers that honor it: agent/agent_init.py:2020 (agent.compression_enabled = cs.enabled) → gates the turn preflight (agent/turn_preflight.py:89,297), idle/turn compaction (agent/turn_context_compaction.py:154,182,240), native-compaction helpers (agent/native_compaction.py:120), and agent/conversation_compression.py:1998. So compression.enabled: false is the single invariant-preserving write. Per-route triggers worth naming in the recipe: codex_app_server_auto (native|hermes|off, default native), codex_responses_native (default False), idle_compact_after_seconds (default 0), micro_compact (default False).

    (2) Runtime capability — yes, hot reload exists, no restart needed. _sync_agent_model_with_config() (tui_gateway/model_switch.py:450) runs on the arriving turn (tui_gateway/prompt_turn.py:690) and re-applies live compression config to already-open sessions: tui_gateway/session_compression.py:101 sets agent.compression_enabled from the raw config value; tests/tui_gateway/test_compression_config_hot_reload.py documents exactly this ("adopt live compression config on the next turn" after hermes config set compression.threshold_tokens …). Supported write path: hermes config set compression.enabled false — boolean coercion via _SCALAR_WORDS (hermes_cli/config.py:3206 _coerce_config_set_value), writing the RAW user config with ruamel comment preservation + section guards + a backups module, so no clobber and no defaults dump. Option B is feasible today with no new Hermes API: the plugin latches at import/load time via set_config_value, fails open, alarms like #3820 when the read-back is not false; open sessions adopt it on their next turn. Option A then stays as a fresh-install convenience write. Our vote: B (A optional), matching the dsh precedent.

    (3) Marker scope — yes, all lanes. Our plain-http lane and the Codex/Responses/Anthropic server-side paths are the same failure class for clients; a per-session {at, boundary, hostLane} field is worth more than a Hermes-only field.

    One caveat worth putting into the remediation text: with compression.enabled=false the preflight only warns on context overflow (agent/turn_preflight.py:212 "Uncompressed session guard") and hands an oversized request to the provider un-truncated — on a bili-managed lane that is exactly the desired ownership split (manual /compress keeps working on the force path, conversation_compression.py:3193,4103), but it means the client-side folder has to stay healthy, because the provider answers 400 request exceeds the context window … requests are never truncated. Happy to test a candidate PR against this rig (forward lane, plain-http endpoint, pinned fallback chain).

  5. ranxianglei commented on Oct 23, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

    (ai: vllm-qwen/qwen3.8-27b)

    Thanks — those verified answers unblock most of this, and you caught a real error in my earlier assumption: there is no compression.auto key; the master switch is top-level compression.enabled, and hot reload already exists (session_compression.py:101 adopts it on the next turn). That turns #1 from "guess the key" into "target a known, documented switch." Where things stand:

    已交付:#2 → PR #4459(all-lane marker, as you confirmed)

    I shipped ask #2 this turn as PR #4459 — #4459 : a new HOST-NATIVE COMPACTION section in acp_status, shown per-session when a host-native compaction landing is recorded (session.metadata.nativeCompactionBoundary). It names the resolved client/lane, the landing time, and rebase state (NOT yet rebased vs rebased onto it at <ts>). It is lane-neutral and works in both compression modes (the boundary is set server-side by every prepare-*/relay path), so hermes/codex/omp/etc. all surface it — matching your "all lanes are the same failure class" point. Additive display-only output (absent when no landing; no wire/config/cache change). Regression test asserts both gate directions; targeted suites green locally (acp-status 8/8, codex-official 2/2), typecheck clean, full verdict on CI. It references but does not close #4458.

    #1 + #3:held for owner sign-off + your rig validation

    #1 (disable hermes' native auto-compaction) and #3 (hermes hint row) are deliberately not in #4459, for two reasons:

    Converged design (my rec = your vote = Option B): the in-repo hermes Python plugin latches at import/load time — set hermes' compression.enabled=false through the host config path, fail-open (never block hermes boot or model traffic), and emit a #3820-style boot alarm if the read-back isn't false. Open sessions adopt on their next turn via the existing hot reload, no restart. Option A (Node-installer surgical merge-write, opencode-style) stays as a fresh-install convenience/fallback. B preserves the installer's "never parse config.yaml" boundary and delivers the boot alarm you asked for.

    Your 400 caveat is correct and will go into the remediation/recipe text: with compression.enabled=false, hermes only warns on overflow and hands the oversized request to the provider un-truncated, so the provider answers 400 … requests are never truncated. On a bili lane that's exactly the ownership split we want (bili owns folding; manual /compress still works on the force path) — but it means bili's client-side folder must stay healthy or the provider 400s. I'll document that tradeoff explicitly in #1's hint row + recipe doc (mirroring #3294).

    What I need from you (rig validation for #1): against Agent v0.22.3 (build 5b147ab036d6), please confirm the exact load-time entry point the plugin should call to flip compression.enabled — the precise set_config_value(...) module/signature — and that a value written before session start is honored on the first turn (not merely adopted later). If you can exercise a candidate PR against your forward-lane / plain-http / pinned-fallback rig, that's precisely the missing validation; I'd rather have you hit the real API than guess. Once you confirm the call site (or the owner says "go read hermes source"), I open the follow-up PR with #1 + #3 together.

    结构化八问(#4458 现状)

    1. 是什么问题:hermes 是唯一 setup 不关宿主原生自动压缩的车道(默认双压缩器);宿主落 native compaction 在 acp_status 里没有可查询标志。
    2. 什么原因导致:(a) 各车道补 parity 时 hermes 被漏;(b) 检测机制本已存在,但只喂给 conflict 告警/log,没提升为可查询状态。
    3. 影响范围与严重程度(按选项):
    4. 怎么修复的:fix: address all code review findings (condense, routing, session-id, dead code) #2 已做(PR [PR] feat(acp-status): surface host-native compaction landings as an explicit per-session marker (#4458) #4459,增量观测字段);fix: keep system prompt byte-stable for prefix cache #1 推荐 B(load-time latch compression.enabled=false + fail-open + [PR] fix: alarm loudly when the dsh compaction-disable overlay cannot latch (#3806) #3820 式报警,宿主热载下次 turn 生效);Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3 随 fix: keep system prompt byte-stable for prefix cache #1 补 Hermes hint 行(conflictRemediation + web/client.ts + i18n zh/en)。三者同属「宿主原生压缩处理」一族 → 一个 follow-up PR 闭环。
    5. 是否有回归(按选项):
    6. 是否破坏缓存:否(fix: address all code review findings (condense, routing, session-id, dead code) #2 展示面;fix: keep system prompt byte-stable for prefix cache #1 是 host 侧开关;都不动前缀缓存/fold 判定/去重键)。
    7. 是否改了设计方向:fix: keep system prompt byte-stable for prefix cache #1 走 B 是把「宿主原生压缩治理」从 installer 挪到 runtime 插件(与 dsh [PR] fix: alarm loudly when the dsh compaction-disable overlay cannot latch (#3806) #3820 同向),不改整体架构;走 A 则扩 installer 的 host-config 写入面。fix: address all code review findings (condense, routing, session-id, dead code) #2/Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3 纯增量。
    8. 是否引入新配置:不引入 bili 侧 config/env。fix: keep system prompt byte-stable for prefix cache #1 写的是 hermes 自己的 compression.enabled;fix: address all code review findings (condense, routing, session-id, dead code) #2 是 acp_status 输出字段(非配置)。

    判定:#2 已进 PR #4459,等 review/CI 即可合;#1+#3 卡在两点——owner 拍板 A/B(我推荐 B) + 你确认 hermes 精确 load-time 调用点(或 owner 让我翻 hermes 源码),两者齐了我就开一个 follow-up PR 把 #1+#3 一起做完。当前不再动代码。

  6. MojitoJoe1813 commented on Oct 23, 2026

    @MojitoJoe1813
    Author

    Rig validation for #1, graded so you can see what is measured and what is inference. Rig: Hermes Agent v0.22.3 (2026.9.24), local build 5b147ab036d6. Everything below was read off the installed tree (/root/.hermes/installs/76f6e7e5145b5f39/environments/e4a140c216d7402ab1b11ff54568c00e/workspace), which is the code that actually runs here.

    1. The exact load-time call site (measured fact)

    • Module + signature: from hermes_cli.config import set_config_value, live definition def set_config_value(key: str, value: str, force: bool = False) at hermes_cli/config.py:3406. Call shape for the latch: set_config_value("compression.enabled", "false").
    • Coercion is host-side, so a plain string is correct: _SCALAR_WORDS['false'] yields the boolean false via _coerce_config_set_value (hermes_cli/config.py:3198,3206). No force=True needed - the key is known, so no wrong-prefix refusal.
    • It writes only the raw user config: _write_user_config docstring says "Write only the user's raw config back (never the merged defaults)" (hermes_cli/config.py:3373). Other entries survive.
    • Guards your recipe text must name, because a plugin that only catches Exception dies here: _exit_invalid and _exit_if_key_managed both call sys.exit(1) (hermes_cli/config.py:3368-3370, :3345ff) - that raises SystemExit, not an Exception. is_managed() short-circuits with a print and returns (:230, :3406 first lines); on this rig we probed it live and it returns False, so the write path is open here.
    • Load deadline matters for a load-time latch: per-plugin loads are capped by plugins.load_timeout_seconds, default _LOAD_TIMEOUT_SECS = 10.0 (hermes_cli/plugins_loader.py:44-45), clamped at 600 s; after a load timeout every later registration is ignored (PluginContext.mark_load_timed_out). So: latch first, tool registration second, non-blocking, fail-open.
    • Our entry point is register(ctx) in hermes-plugin/__init__.py (installed copy line 1140), whose own file header says nothing may raise out of it. The latch goes inside its existing try-guard, before any tool registration.

    2. Is a value written before session start honored on the FIRST turn?

    • Measured fact: the value is consumed at agent construction - agent.compression_enabled = cs.enabled (agent/agent_init.py:2020) - and every auto-compaction gate reads exactly that attribute: agent/turn_preflight.py:89,297, agent/turn_context_compaction.py:154,240, agent/native_compaction.py:120. Hot reload for already-open sessions exists as described (tui_gateway/prompt_turn.py:691 -> tui_gateway/session_compression.py:174 -> _apply_live_compression_config, assignment at :101), short-circuiting only when the config signature is unchanged.
    • Inference we are not measuring live right now, with our confidence: "a session created after the write skips host compaction from its very first turn" - 90 %. "Open sessions adopt it on their next turn" - 95 %. Both rest on the code chain above plus the regression test in the source checkout (tests/tui_gateway/test_compression_config_hot_reload.py); note that test ships in the checkout, not inside the installed tree.
    • One ordering caveat, honest: plugin discovery runs at import of model_tools.py:162 and at gateway startup (gateway/config.py:577, gateway/run_startup.py:1078), so in practice a load-time latch is armed before any session agent exists; the TUI agent factory calls discovery only inside a toolset-pin branch (tui_gateway/agent_factory.py:354). We rate "latch precedes first agent construction on this rig" at 85 %, and the [PR] fix: alarm loudly when the dsh compaction-disable overlay cannot latch (#3806) #3820-style read-back alarm you planned is exactly the right cover for the residual risk.

    3. PR #4459: reviewed against the v0.1.205 tree - ship it

    • The marker's data source is real on our lane: markNativeCompactionBoundary() (src/session.ts:1353) is called from src/server/prepare-openai.ts:178 (plain-http forward - our shape), src/server/relay.ts:1738 (attach relay), src/server/prepare-anthropic.ts:286; the rebase transition runs at prepare-openai.ts:179, prepare-anthropic.ts:287, prepare-responses.ts:70. So the "NOT yet rebased" vs "rebased onto it at" states are produced server-side per request path, not synthesized in the display layer.
    • Lane naming resolves for us specifically: the Hermes plugin stamps x-bili-plugin: hermes (hermes-plugin/__init__.py:44, header merge at :1070), bili records it as session.metadata.pluginAgent (src/server/handle.ts:836,1496), and conflictClientOf() returns it (src/conflict-watch.ts:111-119). On this rig your line reads "the client (hermes) compacted this conversation natively ...". Rendering we have not seen live, so: chain measured, display expected (95 %).
    • The change is additive display-only (extra.push(...) plus a test with a negative gate asserting no marker when no landing was recorded). No wire/cache/fold semantics touched. Good as-is.
    • Optional, not a blocker: ProxyToolResult already carries machine-readable fields (outcome, reason, src/proxy-tool-result.ts:37-46) while this marker is prose. A matching optional field on the acp_status result, e.g. nativeCompaction?: { at: number; pendingRebase: boolean; rebasedAt?: number; lane: string }, would let the panel/relay read the boundary without parsing text. Happy to test that variant if you add it.

    4. Exercise a candidate PR on our rig - we cannot do that today, and here is why, plainly

    We took billion-context out of operation on 22 Oct. The reason was not one proven bili defect: two chat symptoms kept recurring (a compress call that failed with a JSON-shaped refusal, and old prompt content resurfacing later in the chat), and the measured root causes were Hermes-side tool deferral/pinning plus host-native compaction rewriting the history under bili - i.e. exactly the double-compaction class this issue describes. Taking the lane out stopped the symptom for everyday chats.

    So: your #1/#3 confirmation stands on source measurement (sections 1-2), and a candidate build can be reviewed the same way we reviewed #4459 - line by line against a tag tree.

    5. One correction to my previous comment

    I cited agent/conversation_compression.py:3193,4103 for "manual /compress keeps working on the force path". Those two lines prove the force path bypasses the thrash latch and the cooldown. The absence of the master gate on the manual path is proven by two other places: gateway/slash_commands_session.py:685-760 and agent/compression_facade.py:227 never consult compression_enabled. Behaviour as such: 90 % (source-level, not run here). Your recipe text should cite those, so nobody reads it as "force flips the master switch off-guard".

  7. ranxianglei commented on Oct 23, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

    (ai: vllm-qwen/qwen3.8-27b)

    Outstanding validation — the graded measured/inference split, the SystemExit gotcha, and the load-timeout constraint are exactly what I needed. Two things first:

    Correction accepted (§5): you're right — conversation_compression.py:3193,4103 prove the force path bypasses the thrash latch/cooldown, but the absence of the master gate on the manual path is proven by gateway/slash_commands_session.py:685-760 and agent/compression_facade.py:227 never consulting compression_enabled. The #3 recipe/hint text will cite those two, so nobody reads it as "force flips the master switch off-guard."

    PR #4459 — keeping it as-is (your "good as-is" stands)

    Thanks for the line-by-line review against v0.1.205 — the server-side boundary production and the (hermes) lane resolution matching your rig is strong confirmation. On the optional machine-readable field: I'm deliberately not adding it to this PR. acp_status returns a single prose text blob (toolOk(...) at src/acp-status.ts:508), and every diagnostic in it is a stable-prefix line (DEAD REFS —, COMPRESS CIRCUIT BREAKER: ARMED —, …). My HOST-NATIVE COMPACTION — <lane> … at <ts> line follows that exact idiom and is grep-parseable the same way. A true structured field would mean extending the shared ProxyToolResult envelope (src/proxy-tool-result.ts:37) with an acp_status-only member plus teaching the forwarding layer to carry it — a cross-cutting contract change that's not warranted for an "optional, not a blocker" nicety inside this additive PR. If you want envelope-level parsing, that's a clean small follow-up; happy to take it on its own. #4459 otherwise awaits owner merge (merge is human-only) after CI.

    #1 — fully specced from your measurements; needs the owner's go

    Everything for Option B is now pinned down. The implementation I'd build (and re-verify against the real hermes tree while doing it — I won't ship an external account's line numbers blind):

    • Where: inside register(ctx) in hermes-plugin/__init__.py, within its existing try-guard, before any tool registration (latch first, registration second — keeps it inside the plugins.load_timeout_seconds default 10 s budget).
    • Call: from hermes_cli.config import set_config_value → set_config_value("compression.enabled", "false") (host-side _SCALAR_WORDS['false'] coercion; no force=True; raw-config-only write, other entries survive).
    • The gotcha you flagged: _exit_invalid / _exit_if_key_managed call sys.exit(1) → raises SystemExit, not Exception. The fail-open guard must catch (Exception, SystemExit) (or BaseException), log + alarm, and continue — catching only Exception would kill the load.
    • Fail-open, always: any exception/timeout/managed-key short-circuit skips the latch without blocking hermes boot or model traffic.
    • Read-back alarm ([PR] fix: alarm loudly when the dsh compaction-disable overlay cannot latch (#3806) #3820-style): after setting, read the value back; if it isn't false, emit a startup alarm. This covers the 85 % residual you rated for "latch precedes first agent construction."
    • Open sessions adopt on their next turn via the existing hot reload (your 95 %); new sessions skip host compaction from turn one (your 90 %).

    My recommendation = B (= your vote, = dsh #3820 precedent): preserves the installer's "never parse config.yaml" boundary, delivers the boot alarm you asked for, self-heals every start. Option A (Node-installer surgical merge-write, opencode-style) stays as a fresh-install convenience/fallback. #3 (Hermes hint row across conflictRemediation + web/client.ts + i18n zh/en) ships in the same follow-up PR. One issue → one follow-up PR, closed loop.

    Urgency noted: you took the lane offline on 22 Oct because of exactly this double-compaction class. Understood — the moment the owner confirms B, I'll have the follow-up PR up the same day.

    结构化八问(#1 决策)

    1. 是什么问题:hermes setup 不关宿主原生自动压缩 → 默认双压缩器;宿主中途 native compaction 重写历史、落在 bili 视野外 → ref space 变 stale → compress 打到死 range → 会话砖化(正是你们 22 Oct 下线该车道的那类症状)。
    2. 什么原因导致:各车道补 parity 时 hermes 被漏(installer 只拷文件 + enable,且刻意不碰 config.yaml)。
    3. 影响范围与严重程度(按选项):
    4. 怎么修复的:见上 B 的具体实现(register() 内、tool 注册前 latch compression.enabled=false,catch (Exception,SystemExit),fail-open,读回报警);Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3 随 PR 补 Hermes hint 行,文案引用你更正后的手动路径位置。
    5. 是否有回归(按选项):A=installer 新增 config.yaml 写路径,须 merge-preserving + .bili-bak + remove 还原(绝不静默吞用户配置);B=插件 load 新增行为,严格 fail-open,读回失败/超时都不阻断启动或 traffic,两种压缩模式语义不变;Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3=纯 hint 文案,三处同步 zh/en 一致。
    6. 是否破坏缓存:否(fix: keep system prompt byte-stable for prefix cache #1 是 host 侧开关,不动前缀缓存/fold 判定/去重键)。
    7. 是否改了设计方向:B 把「宿主原生压缩治理」从 installer 挪到 runtime 插件(与 dsh [PR] fix: alarm loudly when the dsh compaction-disable overlay cannot latch (#3806) #3820 同向),不改整体架构。
    8. 是否引入新配置:否 bili 侧 config/env;fix: keep system prompt byte-stable for prefix cache #1 写的是 hermes 自己的 compression.enabled。

    判定:#2 已进 PR #4459(等 owner 合 + CI);#1+#3 的全部实现细节已按你的实测钉死,只差 owner 拍板 A/B(我推荐 B)——你一句「B,干」我今天就开 follow-up PR。当前不再动代码。

  8. MojitoJoe1813 commented on Oct 23, 2026

    @MojitoJoe1813
    Author

    B, go. Option B confirmed - please build it exactly as you pinned it to our measurements.

    • Latch first, tool registration second, inside the 10 s load budget; non-blocking, fail-open.
    • Catch (Exception, SystemExit) on the write path (_exit_invalid / _exit_if_key_managed -> sys.exit(1)), log + alarm, continue. Catching only Exception kills the load.
    • Read-back alarm after the write: that is the right cover for the 85 % residual I rated for "latch precedes first agent construction".
    • Keep the manual-path citation as agreed (gateway/slash_commands_session.py:685-760, agent/compression_facade.py:227) and keep the oversized-request caveat in the hint text ("with host compaction off, oversized requests reach the provider un-truncated").

    Structured field: agreed, it does not belong in #4459 - a shared-envelope change for a display nicety is the wrong trade. Open your own follow-up for it whenever you want; we will review and test that variant on its own merits.

    From this rig today: when the follow-up ships, I review it line by line against a tag tree (same method as #4459) and report measured facts separately from inference, with confidence stated. What I cannot do from this rig right now is a live run - our lane is offline - so treat any "we exercised it" claim as pending until the lane comes back under your #1/#3 build.

    Ship it.

  9. ranxianglei commented on Oct 23, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

    (ai: vllm-qwen/qwen3.8-27b)

    Thanks — and thanks for agreeing the structured field belongs in its own follow-up, and for the line-by-line / measured-vs-inference review commitment. Noted that live runs are pending until the lane is back under the #1/#3 build, so I'll treat any "we exercised it" claim as pending too.

    One process point before I cut the branch: #1 is a behavior change — bili would now mutate the hermes host config (compression.enabled=false) at plugin load, plus add a load-time latch inside the plugin. Per the project rule (and the gate I set for #1), that A/B call is the owner's to make, not a contributor's. Your confirmation is strong corroboration and I independently recommend B, but I'm not going to start a behavior-change implementation on an external account's "go" alone — the deciding vote has to come from the owner.

    @ranxianglei — one word from you ("B, go") and I build the follow-up PR today, exactly as pinned last turn:

    • latch in register(ctx) before tool registration, inside the 10 s load budget, non-blocking, fail-open;
    • set_config_value("compression.enabled","false"), catch (Exception, SystemExit) → log + alarm + continue (catching only Exception kills the load);
    • read-back alarm covering the residual "latch precedes first agent construction" risk;
    • Use kernel renderTags:"text-only" + forbid tag echoing in prompt #3 Hermes hint row (conflictRemediation + web/client.ts + i18n zh/en) citing the agreed manual-path lines (slash_commands_session.py:685-760, compression_facade.py:227) + the oversized-request caveat ("with host compaction off, oversized requests reach the provider un-truncated").

    Decision-relevant recap for your call:

    • What changes: hermes lane defaults to single-compressor (host auto-compaction off); behavior change, both compression modes unaffected (it's a host-side switch).
    • Regression guardrails: strict fail-open — any exception/timeout/managed-key skip leaves hermes boot and model traffic untouched; installer's "never parse config.yaml" boundary preserved (latch lives in the runtime plugin, not the Node installer).
    • Cache / identity: untouched (no prefix-cache, fold-judgment, dedup-key, or ref-space change).
    • New config: none on bili's side — only writes hermes' own compression.enabled.
    • I'll re-verify every hermes call site against the real tree while building (not trusting external line numbers blind), and the PR opens for your review + merge — nothing ships without your merge.

    Standing by for your sign-off.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghermes改动范围:内核之外的主机侧接线(src/agent 适配器、server 路由、注入拦截)/范围兜底/客户端标签p1scope/wiring

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions