Repository navigation
fix: wire the #2621 novelty gate on the anthropic and google dsh lanes - #2775
ranxianglei wants to merge 1 commit into
Conversation
carriesDshLocalCompactionSummary(msgs) was called without the pre-turn ref map on prepare-anthropic.ts and prepare-google.ts, although knownRefsBefore is already computed there — the openai (#2621) and responses lanes pass it. Without the second argument a USER-role message that merely QUOTES the checkpoint framing and is replayed (identical raw bytes → an OLD id in messageRefs.byRaw) passed the carrier gate alone; combined with ordinary drift decimating fold coverage (missing ≥ DSH_LOCAL_COMPACTION_MIN_MISSING) the lanes false-fired the native-compaction rebase and resetSessionCompression wiped live ACP state — the v0.1.190 incident class shipped on the two lanes #2658 added. Also ports the #2621 negative (old-id framing quote + real gap → no rebase) to /v1/messages and generateContent; red without the wiring, green with it.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3052-pr.2775.7885d2eThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2775.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Working on it now. Bug confirmed in-tree: Plan:
Full report with the structured conclusion follows once CI-visible evidence is in. |
[bot] 🏷 Done — PR #2783 (Closes #2775): #2783 Two commits: (1) the one-line 1. 是什么问题: #2658 把 dsh native-compaction 检测器移植到 anthropic/google 两条线时漏传了 pre-turn ref map,#2621 的 novelty gate 在这两条线上完全失效——用户消息里引用的 checkpoint framing 被字节一致地重放、叠加普通 fold 漂移时,会误判 native compaction 并静默清空全部 ACP 状态。 判定:可合并——diff 收敛为两行接线 + 一处 parity guard + 测试,定向证据本地全绿,全量回归交给 CI。 |
|
Closing as superseded by #2783. Both PRs fix the same defect: #2658's anthropic/google port called |
What
#2621added a novelty gate tocarriesDshLocalCompactionSummary(a freshly-landed checkpoint is a NEW id; a quoted/replayed mention hits an OLD id) and wired it on the openai and responses lanes.#2658then shipped the detector on the anthropic (src/server/prepare-anthropic.ts) and google (src/server/prepare-google.ts) lanes — but called it without the second argument, althoughknownRefsBeforeis already computed at both call sites:Why it matters
Without the ref map, only the carrier gate ① runs: any user-role plain-text message that merely quotes the checkpoint framing (
DSH_CHECKPOINT_OPEN_TAGanywhere in the text, or the preamble prefix) satisfies it. A user pasting checkpoint text in an earlier turn, replayed with identical raw bytes → an OLD id inmessageRefs.byRaw. Combined with ordinary edit/truncate/resume drift decimating fold coverage (missing ≥ 8andmissing*2 ≥ expected), the lane false-recorded anative-compactionconflict, ranmarkNativeCompactionBoundary+reconcileNativeCompactionBoundary, andresetSessionCompressionsilently wiped all live ACP state (folds, refs, content store) — exactly the false-rebase profile#2621fixed on openai in v0.1.190, reborn on the two new wires.Refs are high-water pinned (
reserveRefsThrough), so this is recoverable — but it silently restarts compression from scratch plus a false "another compressor ran" attribution.Change
prepare-anthropic.ts/prepare-google.ts: passknownRefsBefore(one line each, same wiring + comment shape as the openai lane).#2621negative to both new wires — a seeded user message quoting the framing, replayed byte-identical (old id) + a real fold gap (8/9 covered ids missing) must NOT rebase, must NOT record anative-compactionconflict, and the live fold must survive.dsh-compaction-guard.ts("every in-repo caller passes it") is true again.Verification
tests/issue2432-dsh-local-compaction11/11,tests/issue2451-dsh-responses-compaction4/4,tests/issue2709-dsh-native-compaction-attribution5/5,tests/e2e-anthropic6/6 — all green.