Skip to content

fix(acp-status): aggregate pre-compaction archive section by reason in default view (#3105) - #3111

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-14_fix-3105-acp-status-archive-aggregate
Oct 14, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-10-14_fix-3105-acp-status-archive-aggregate

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Behavior change (intended, #3105): the default acp_status PRE-COMPACTION ARCHIVE section changed from one line per archived block (b1 — <reason> ×N) to per-reason counts (<count>: <reason>) plus a hint pointing at an opt-in detail view. For the issue's exact scenario (237 blocks, one reason): ~20.2 KB of identical lines → 3 lines (~0.3 KB); the whole default receipt measured 740 B after vs ~20.9 KB before. Per-block ids + reasons stay reachable via acp_status({ archiveDetail: true }), capped at 50 lines with an explicit omitted count (+187 more; showing first 50 of 237), so a 1,000-block archive still costs one bounded section.

What changed

Downstream consumers checked: both text parsers anchor on the unchanged PRE-COMPACTION ARCHIVE — head prefix and treat indented lines as continuation (src/acp-panel.ts, src/marker/status-body.ts) — all new lines stay indented, render-contract test green for both modes.

Config surface: none. No config-file key, env var, or CLI flag. archiveDetail is an optional tool-call argument parsed host-side in handleAcpStatus; it is deliberately NOT added to the kernel tool schema (kernel changes are gated) — same pattern as the existing Tip-line-taught args (scope/view/tool) that the host already accepts while ACP_STATUS_TOOL_OPENAI.parameters.properties stays {} with no additionalProperties:false, so providers pass the extra key through.

Verification: targeted suites green locally (tests/compaction-archive.test.ts, tests/marker-render-contract.test.ts — 15 tests), typecheck clean; full-suite verdict = CI on this head. Rendered the issue's scenario end-to-end: default receipt constant-size regardless of block count; detail bounded by the cap.

Closes #3105

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-14_fix-3105-acp-status-archive-aggregate (0093618)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.3557-pr.3111.c62be19

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

Option B — Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei force-pushed the 2026-10-14_fix-3105-acp-status-archive-aggregate branch from d8e70c7 to cce5073 Compare October 14, 2026 03:40
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

PR #3111(修 #3105)review 完成。独立核对了 diff、下游消费者代码、CI 全量日志(6820 pass / 4 fail)。结论:代码可合,CI 红是 master 既有噪音,与本 PR 无关。

结构化八问

  1. 是什么问题:一次历史重写归档几百个 block 时,acp_status 默认视图逐块打行(b1 — reason ×N),单次工具回执膨胀到 ~20KB(acp_status 全量展开归档块,重复提示过于冗余 #3105 场景 237 块 → ~20.2KB 重复行),且每次回显该回执的请求都被拖累。
  2. 什么原因导致的:渲染路径无条件逐条枚举归档 block,无聚合、无上限;附带缺陷——header 对所有条目断言 "replaced by the client's native compaction summary",把 [Bug][proxy] unframed host-side history deletion leaves zombie fold blocks rendering carriers forever — one carrier flaps in/out every turn (persistent prefix-cache churn) #2695 substrate-destruction 归档也标错了机制。
  3. 影响范围与严重程度:所有 pre-compaction archive 非空的会话;默认回执体积随 block 数线性增长。严重度:上下文/token 浪费 + 大归档会话下回执过大,非数据丢失、非功能损坏。
  4. 怎么修复的:在渲染源头聚合——默认视图按 reason 计数(count-desc)+ 指向 opt-in 详情的提示行;详情模式逐块列出但封顶 50 行 + 显式省略计数(+187 more; showing first 50 of 237)。header 改为同时点名两种机制(native compaction 或 unannounced rewrite),各 reason 保留自己的措辞。section 尺寸与 block 数解耦(300 同因 block → 恒定 3 行,测试钉死)。
  5. 是否有回归问题:审过的既有行为——①空 archive 路径不变(guard 条件未动);②两个下游文本解析器(src/acp-panel.ts:202、src/marker/status-body.ts:47)都锚定不变的 head 前缀 PRE-COMPACTION ARCHIVE — ,把缩进行当 continuation,新增行全部两空格缩进、逐一核对过 CONTINUATION 规则(^ {2,}\S)全部命中;新加的 marker-render-contract 用例对两种形状都断言整段被消费(residual == ""),acp_status visibility markers: stripMarkerLines removes the head line but leaves the multi-line report body in incoming history (#1029 follow-up) #2789/Inbound markers: one declarative strip engine for all four wires (#2789, #2798, #2811 plan B) #2815 漂移护栏生效;③reason 字符串生产端(src/session.ts)与 decompress-shared.ts:579 的逐块报错文案均未动;④旧 header 整句在 src/tests 中无其他消费者依赖(CI 全量除金色测试外全绿佐证)。有意变更(默认输出形状)已在 PR 正文按旧值→新值披露。未发现无意回归。
  6. 是否破坏缓存:不涉及——acp_status 每次调用现算,无缓存/游标/去重键;持久化的 preCompactionArchive 记录本身只读不动,仅改渲染。
  7. 是否改了设计方向:无架构变化,单模块渲染改动。一个小面扩展:host 侧可选工具参数 archiveDetail,刻意不进 kernel 工具 schema(kernel 有门禁)——与既有 scope/view/tool 参数完全同模式(kernel schema properties 保持 {} 且无 additionalProperties:false,provider 透传),PR 正文已披露。
  8. 是否引入了新的配置:无。无 config key / env / CLI flag。

CI 状态(独立核实):静态门全绿;test 四平台(ubuntu/windows × node22/24)全红,但失败恰好 4 个,全部是 tests/golden-storage-render.test.ts 的 storage-render golden,且漂移只在 metadata 段(state/blockContents/stats 三段 digest 全一致)——正是已知 master 常红 #3113(#3093 live-stamp 字段进会话 metadata),已有在途修复 #3119/#3120。本 PR 触碰的文件自 merge-base 以来 master 零改动(48 个提交零重叠),mergeable=true。本 PR 自己的 4 个测试(CI ok 795–798)及全部 acp_status/marker 相关测试在该 head 上通过。test 车道要等 #3119 或 #3120 落 master 后才会转绿,rebase 本身解决不了这个红。

判定:按 §7.4 属人工合并档(model 可见输出格式变更 + 新增 opt-in 工具参数,虽单模块纯 fix)。建议:#3119/#3120 落地后 rebase 一下再合(让 CI 全绿留痕);若 owner 认可该红为已知无关噪音,现在也可直接合并。代码侧我这边没有任何需要补的东西。

@ranxianglei
ranxianglei force-pushed the 2026-10-14_fix-3105-acp-status-archive-aggregate branch from cce5073 to 0093618 Compare October 14, 2026 04:17
@ranxianglei
ranxianglei merged commit 2f22bc6 into master Oct 14, 2026
31 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.428-master.2f22bc6 (rolling master tag).

npm install -g billion-context@0.0.428-master.2f22bc6  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

@ranxianglei
ranxianglei deleted the 2026-10-14_fix-3105-acp-status-archive-aggregate branch October 15, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

acp_status 全量展开归档块,重复提示过于冗余

1 participant