Skip to content

[PR] feat(acp-status): surface host-native compaction landings as an explicit per-session marker (#4458) - #4459

Closed
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-24_acp-status-host-native-marker
Closed

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-24_acp-status-host-native-marker

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Adds ask #2 of #4458: an explicit, queryable per-session marker in acp_status for host-native compaction landings.

What

A new HOST-NATIVE COMPACTION section appears in acp_status output when a session has a recorded host-native compaction landing (session.metadata.nativeCompactionBoundary). It shows:

  • which client/lane it was on (resolved via conflictClientOf),
  • when it landed (at),
  • rebase state — NOT yet rebased (pending) vs rebased onto it at <ts> (done).

It is lane-neutral and works in both compression modes: the boundary record is set server-side by every prepare-*/relay path that detects a host-native rewrite (Google/Responses/Anthropic/OpenAI + relay), so hermes/codex/omp/etc. all surface it.

Why

The existing surfaces are reactive — DEAD REFS, the compress breaker receipt, and the conflict-watch section only speak after a failure or once dead refs materialize. This marker is proactive: an operator or agent can see "the host compacted this conversation under bili" before a follow-up call burns a ref minted before the boundary. That is the visibility gap #4458's reporter named ("surface host-native compaction landings as an explicit marker … BEFORE next call burns a dead ref").

Scope — this PR ships only ask #2 of #4458

Behavior change (disclosed)

Additive display-only output. For sessions with no native-compaction boundary the output is unchanged (section absent). Where one exists, one extra section is appended. No wire/protocol change, no new config/env, no cache or identity impact. Reasoned in both modes (boundary set server-side regardless of plugin/proxy mode).

Tests

New regression test asserts both gate directions (#3617): no boundary → no section; pending → NOT yet rebased; rebased → rebased onto it at; lane name resolved from pluginAgent / clientHint. Targeted suites green locally (acp-status 8/8, codex-official 2/2); typecheck clean. Full-suite verdict = CI on the pushed head.

References #4458.

…cit per-session marker (#4458)

Add a HOST-NATIVE COMPACTION section to acp_status, shown per-session when a
host-native compaction landing is recorded (session.metadata.nativeCompactionBoundary),
in BOTH compression modes. It distinguishes "the host compacted this conversation"
from "bili folded it", shows pending-rebase vs rebased state, and names the resolved
client/lane. Proactive visibility ahead of the reactive DEAD REFS / breaker /
conflict-watch surfaces, so an operator or agent can see a landing BEFORE a follow-up
call burns a ref minted before the boundary.

Additive display-only output: absent when no landing was recorded; no wire, config,
cache, or identity impact. Regression test covers both gate directions (#3617).
@ranxianglei ranxianglei changed the title feat(acp-status): surface host-native compaction landings as an explicit per-session marker (#4458) [PR] feat(acp-status): surface host-native compaction landings as an explicit per-session marker (#4458) Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-24_acp-status-host-native-marker (3676ee6)

Latest build — install this exact version

npm install -g [email protected]

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
3676ee6 [email protected] build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。本 PR 是 #4458 ask #2(在 acp_status 里显式标记 host-native compaction 落地)的直接实现;按主题与失败签名检索 open+closed issues/PRs,无并行工作。PR 引用但不关闭 #4458(ask #1/#3 另案跟进),处理正确。

标签: hermes, scope/ui, p1 —— hermes 是该缺陷家族的驱动案例(PR 本身 lane-neutral);acp_status 属展示面故 scope/ui;p1 跟随父 issue #4458 的严重度(会话不可用家族)。

独立复核(非转述 issue 结论):

  • 生产者确为服务端、双模式通用:边界记录由 prepare-openai.ts:178、prepare-responses.ts:70/273、prepare-google.ts:170、prepare-anthropic.ts:286、relay.ts:1738 写入,全部在代理侧,与 plugin/proxy 模式无关——"lane-neutral"声明成立。
  • 形状与文案准确:src/session.ts:1353-1384 写 {at, pendingRebase:true},reconcile 后置 {pendingRebase:false, rebasedAt};PR 里的 cast 是对 Record<string, unknown> 的合法收窄(非 as any)。pending 态文案 "the rebase lands on the next turn" 与实际调度一致:持久 pending 的唯一来源是 relay.ts:1738(Responses native compact,日志自述 "rebase scheduled for next Responses turn"),由 prepare-responses.ts:70 每轮顶部 reconcile;其余 wire 上 mark+reconcile 同轮同步执行,pending 不滞留。
  • 回归面逐项过:handleAcpStatus 仅在 metadata.nativeCompactionBoundary 存在且 at 为 number 时追加两段文字;无边界会话输出逐字节不变(负向门测试钉住)。全部消费者(stream.ts:64 工具路径、loop/core.ts:399 管理路径、acp-panel.ts:174 web 面板)都是结果/展示面,接受追加段落;全仓 grep HOST-NATIVE 无其他解析方碰撞。
  • 测试有效性(Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 双向门):干净→无段落、pending→NOT yet rebased、rebased→rebased onto it at,lane 名分别经 pluginAgent="hermes" 与 clientHint="codex" 解析,断言有牙。本地定向跑 tests/acp-status.test.ts 8/8 绿(含新测试)。
  • diff 整洁:2 文件 +43/-0,每行服务于目的;命名、注释([Hermes lane] Disable Hermes' native auto-compaction during plugin setup, and surface host-native compaction landings as an explicit marker #4458 引用)、风格与周边一致。
  • CI(pushed head 3676ee6):全绿——18 success + 12 skipped(门控 e2e 车道,常态),0 fail。

八问:

  1. 是什么问题:[Hermes lane] Disable Hermes' native auto-compaction during plugin setup, and surface host-native compaction landings as an explicit marker #4458 指出的可见性缺口——host 原生压缩落在 bili 管的会话下时,现有面(DEAD REFS、compress breaker、conflict-watch)都是事后才说话,操作者/模型在下一次调用烧掉边界前的死 ref 之前看不到"host 压缩过这个会话"。
  2. 什么原因导致的:非缺陷修复类——检测机制自 v0.1.205 起齐全(stream 结构判定/fold-pause/metadata 记录),但没有任何一处把 nativeCompactionBoundary 暴露进 acp_status 的可查询输出,信息停在元数据里。
  3. 影响范围与严重程度:本 PR 自身是纯增量展示面,不改任何行为路径;它服务的问题属于 p1 家族(host 原生压缩后 stale fold ledger → 会话不可用)。对无边界会话零影响。
  4. 怎么修复的:在 acp_status 报告里读 session.metadata.nativeCompactionBoundary,按 pending/rebased 两态各出一行;客户端名复用既有 conflictClientOf(pluginAgent 优先、clientHint 兜底)。只读展示,不碰检测/重定基逻辑。记录为单值,新一次落地覆盖旧记录,面板永远显示最近一次。
  5. 是否有回归问题:无。高危模式逐项过:输出格式(仅新增段落,既有段落顺序/措辞不变)、fail-fast 语义(不变)、阈值/时序(不涉及)、错误处理(纯读无 throw 路径变化)。
  6. 是否破坏缓存:不涉及。acp_status 结果是工具结果,不进稳定前缀(proxy 模式下工具调用本就是 ephemeral);不触碰重试/去重键/增量游标。
  7. 是否改了设计方向:不涉及。沿用既有 metadata 记录与 conflictClientOf 解析,未引入新机制。
  8. 是否引入了新的配置:不涉及。无新 env/config/默认值。

行为变更披露(有意,已在 PR 描述披露):acp_status 输出对"有 host-native compaction 记录"的会话多一个 HOST-NATIVE COMPACTION 段落(pending/rebased 两态);其余会话逐字节不变。

判定:可合。feat 类按 §7.4 需人工合并;CI 已全绿,定向测试本地复验通过,无阻塞项。ask #1(hermes 安装期禁用原生压缩)+ #3(hermes 补救提示行)留待后续 PR 跟进 #4458,本 PR 范围切割清晰,无异议。

@ranxianglei ranxianglei added hermes 改动范围:内核之外的主机侧接线(src/agent 适配器、server 路由、注入拦截)/范围兜底/客户端标签 p1 scope/ui labels Oct 23, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

已并入合并列车 #4551(master 合并,merge commit 保留原作者署名)。本 PR 关单收尾;回滚点为 #4551 单提交 revert。

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

Labels

hermes 改动范围:内核之外的主机侧接线(src/agent 适配器、server 路由、注入拦截)/范围兜底/客户端标签 p1 scope/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant