Repository navigation
fix: port dsh native-compaction single-turn rebase to anthropic + google lanes (#2658) - #2684
ranxianglei wants to merge 2 commits into
Conversation
…gle lanes (#2658) The #2432 detector (dsh desktop compaction landing without transiting bili → checkpoint framing in resent history + decimated fold coverage → mark+reconcile in-turn) shipped only on the openai and responses wires. On the anthropic wire a landed checkpoint left ACP state unrebased forever: partially-alive blocks, self-destructing fold anchors, and every later compress failing 'cannot be anchored' (the #2432 death spiral); the google wire had the identical gap. Port the dual-signal gate verbatim from prepare-openai.ts / prepare-responses.ts to prepare-anthropic.ts and prepare-google.ts (same constants, same thresholds, same conflict-ledger classification). On the anthropic wire the existing detectUnannouncedHistoryRewrite block is now skipped when the rewrite was just classified as dsh native compaction — mirroring the openai lane, so one event is recorded ('native-compaction'), not two. Regression tests: tests/issue2658-dsh-local-compaction-lanes.test.ts — positive rebase e2e per new wire (anthropic /v1/messages, google :generateContent) plus the no-framing negative on the anthropic wire.
…nd while testing #2658) npm install regenerated the lock against the in-repo file: devDependencies: acp-kernel 0.0.110 → 0.0.111, billion-context-pi-subagents 0.1.3 → 0.1.4, matching kernel/package.json and pi-subagents/package.json already on master. No dependency or content change.
[bot] 🏷 收到,开始 review 这个 PR(anthropic + google 线路的 dsh native-compaction 单轮 rebase 移植)。先拉分支核对代码与 CI,随后按八问体例给结论。 |
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2887-pr.2684.271cc8bThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2684.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Drive-by (review of #2684): master's lockfile lags the in-repo component versions — acp-kernel recorded 0.0.110 while kernel/package.json is 0.0.112 (d16c341), and billion-context-pi-subagents recorded 0.1.3 while pi-subagents/package.json is 0.1.4. Align both entries to what npm install writes against current master. No dependency or content change.
|
Closing as duplicate of #2664 — both PRs implement the same fix for #2658 (porting the #2432 dual-signal dsh native-compaction rebase gate from Why #2664 survives:
Recorded nuance (no action forced): this PR's anthropic gate omits the |
Fixes #2658
是什么问题
#2432 的单轮 rebase 兜底(dsh 原生压缩未经过 bili 落地 → 检测 checkpoint framing + fold coverage 锐减 → 当轮 mark+reconcile)只落在 openai 与 responses 两条线路。anthropic 线路完全没有恢复路径:checkpoint 落地后 ACP 状态永久未 rebase——部分存活的 block、自毁的 fold anchor、之后每次 compress 都 "cannot be anchored"(#2432 死亡螺旋);google 线路同样缺失。
怎么修复的
把 prepare-openai.ts / prepare-responses.ts 的双信号门(同一常量、同一阈值、同一 conflict-ledger 分类)原样移植到 prepare-anthropic.ts 与 prepare-google.ts。anthropic 线路上,当本轮已分类为 dsh native compaction 时跳过既有的 detectUnannouncedHistoryRewrite 块(镜像 openai 线的 !dshRebased 门)——一次事件只记一条(native-compaction),不再旁边多记一条 unannounced-rewrite。
Behavior change disclosure(行为变更披露)
测试证据(本地定向,全量交给 CI)
Drive-by(独立标注 commit)
第二个 commit 同步 package-lock.json 中滞后的 file-link 版本(acp-kernel 0.0.110→0.0.111、billion-context-pi-subagents 0.1.3→0.1.4),与 master 上 kernel/package.json、pi-subagents/package.json 实际版本对齐;npm install 再生成,无任何依赖或内容变更。