Repository navigation
[PR] fix(#2592): rebase dsh native compaction on the Anthropic Messages lane too - #2599
Closed
ranxianglei wants to merge 2 commits into
Closed
ranxianglei wants to merge 2 commits into
ranxianglei wants to merge 2 commits into
Conversation
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2864-pr.2599.c539bdbThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2599.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
[bot] 🏷 PR review 完成(本 PR 出自 #2592 工作线程,按「识别自己的 PR」规程执行:核对代码 + CI + 回归审查,未重做)。所有验证均为本会话独立复跑,非转述作者声明。 独立验证证据
结构化八问
diff 整洁度:每一行都与本 PR 目的相关;注释全部携带 issue 溯源引用;无空行/重排噪音。 判定:可合。 待余下 2 个 Windows test 矩阵腿转绿即可合并(全局回归由 CI 把关,定向验证已全部通过)。 |
Owner
Author
…ne too The #2432 dsh local-compaction detector (f48424c) landed on the OpenAI lane only. A dsh desktop session riding the Anthropic Messages lane (Anthropic-compatible endpoints) hit the pre-#2432 death spiral when dsh compacted locally: the first replay of [checkpoint summary, retained tail...] against the same session id left the ACP state unrebased — syncBlocks kept partially-alive blocks whose dead refs the nudge kept broadcasting, every later compress failed ("every ref is unknown to this session"), and the compress circuit breaker armed after four consecutive failures (#2592 repro, bili 0.1.189 / DSH Desktop 0.2.0-rc.2). prepare-anthropic now runs the same detection as the openai/responses lanes: dsh-bound session (metadata.pluginAgent === "dsh") + checkpoint framing in resent history (carriesDshLocalCompactionSummary) + decimated fold coverage (missing >= DSH_LOCAL_COMPACTION_MIN_MISSING and >= half the covered set) -> markNativeCompactionBoundary + reconcile back-to-back, re-seeding refs onto the compacted view in the SAME turn. The #1001 unannounced-rewrite block is skipped when the dsh detector already rebased (same double-record guard as the openai lane). Lane inventory (same PR): responses already fixed (db585ef, in v0.1.189); google — dsh speaks no Google wire (#2360 evidence), so the dsh detector cannot fire there. The google lane's separate missing generic #1001 detector coverage is tracked in #2598.
…xt guard contract Rebased onto current master, where f9d3a0f (#2621) tightened carriesDshLocalCompactionSummary to role=user TEXT messages only (quotes of the checkpoint framing from assistant prose / reasoning / tool results / compress echoes must not fire the detector). This port's call site passes the normalized BiliMessage array, so it inherits the gate automatically — no src change needed. The unit test pinned the pre-#2621 contract (role-less bare shapes reading true); under the tightened gate those shapes read false by design (safe-miss direction). Updated to pin the anthropic wire shape against the CURRENT contract: user-text block arrays still match, an anthropic-lane tool result (role=user, contentType=tool-result) quoting the marker reads false. Verified on the rebased head: typecheck clean, build clean, 22/22 across issue2592-anthropic + issue2432 (#2621 cases included) + anthropic-pck-verbatim + dsh-persona-continuity.
ranxianglei
force-pushed
the
2026-10-10_dsh-compaction-anthropic-lane
branch
from
October 10, 2026 10:23
5f9324d to
a9ddc1d
Compare
This was referenced Oct 10, 2026
Owner
Author
|
(ai: zhipuai-lb/glm-5.3) 陈旧票清理(第三批动作①):目标 issue #2592 已关。为避免重复劳动关闭本 PR;如判断有误请直接 reopen 并留言。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #2592 — 本 PR 实现该 issue 机制家族清单中的 F1(Anthropic 车道 framed-detection 接线);issue 已按粒度纪律重组为 F1–F5 清单,未决 facet(F2/F3/F5)留在 issue 线程待 owner 拍板。
是什么
#2436 的 dsh 本地压缩检测器(f48424c41)只接线在 OpenAI 车道;dsh desktop 走 Anthropic Messages 车道(Anthropic 兼容端点,如 deepseek-official)时,宿主本地压缩落地后 ACP state 不 rebase:partially-alive block 引用已消失的 id → nudge 持续广播死 ref(事故现场 m01196–m01362 vs session highest ref=m01191)→ compress 全灭("every ref is unknown to this session")→ 4 连败熔断。本 PR 把同一检测器移植到 prepare-anthropic.ts。
修法
与 openai/responses 车道完全同构(纯接线 + 复用既有路径):
loopConfig之后、reconcileFoldCoverage/processTurn之前(与其他车道同一位置、同一理由——先 rebase 再让 processTurn 在压缩后的视图上播种新 ref);metadata.pluginAgent === "dsh"(dsh 插件对所有它讲的 wire 都盖 x-bili-plugin,src/agent/dsh-native.ts headersFor URL 无关)+ 存在活跃 block +carriesDshLocalCompactionSummary(msgs)(checkpoint 定界符谓词,协议无关)+foldCoverage缺口 ≥DSH_LOCAL_COMPACTION_MIN_MISSING(8) 且过半;recordConflict("native-compaction")+markNativeCompactionBoundary+reconcileNativeCompactionBoundary背靠背执行(本回合内完成 rebase),并跳过随后的 模型切换后压缩块跨模型失配,新模型收到 61.3 万 token 全量上下文 #1001 unannounced-rewrite 块(防双记账,与 openai 车道同一守卫)。anthropic 车道没有 isTitleGen 概念(auto-mode classifier 在更早处 passthrough),故门中不含该子句——与 responses 车道的处理一致。
四车道清点结果(issue 要求,同一 PR 内完成)
git merge-base --is-ancestor验证)行为变更(明示)
验证
补充一(评审注意,来自 #2592 线程后续现场证据):同环境同症状的另一份现场日志显示一个不同的生产者——主对话因反复 model/provider 切换迁移到
|sub:<fp>persona fork,宿主盖章的 compress/decompress/acp_status 仍解析在陈旧父 id(KDD #9 身份分裂域;honoring the native caller, refusing the witness (#2024)行为其标志)。该替代生产者已单独立项跟踪:#2601 。本 PR 修复的未宣告压缩车道缺口仍然真实存在且由测试钉死,但它不覆盖该 fork-migration 形态;原始事故的最终归因取决于事发窗口日志(两个生产者的判别判据见 #2601)。补充二(2026-10-10,后续现场证据 → 范围澄清):#2592 线程又收到两份新样本,逐条代码核对后确认均不由本 PR 覆盖:(a) 无定界符的全量丢失重写——#2193 升级只观测不行动,而本检测器要求 checkpoint 定界符;(b) #1001 触发并 prune 成功后模型持续重试旧代 ref——receipt 措辞缺口(未告知 ref 空间已重排)。另本轮新发现:rebase 路径(三车道共享的
reconcileNativeCompactionBoundary→resetSessionCompression)不保留 ref 高水位(REF_FLOOR),与applyCompactionArchive的 floor pinning 不一致——记入 issue 清单 F5,待 owner 批准;若批准将直接在本 PR 补一个独立 commit 修复。因此本 PR 由 "Closes #2592" 改为 Follows:它只关闭 F1,F2/F3/F5 的处置决定见 issue 线程。