Skip to content

0.1.200 → 0.1.201 upgrade (#3658 identity change) mass-unfolds persisted sessions incl. Anthropic lane; downgrade re-churns #3752

Closed

Description

@mariopasquali

Summary

Upgrading a production proxy from 0.1.200 to 0.1.201 caused every active session to report thousands of "covered id(s) missing" on its first request after the upgrade. Most were re-anchored, but in several sessions thousands of folded messages could not be matched and re-entered the wire unfolded. The worst Anthropic-lane session went from ~126K to ~998K input tokens in one turn (cache hit 2%). Emergency preflight could not recover it: each fold saved ~2.7K tokens (0%), and one preflight ran for 504 s before the client disconnected.

This contradicts the upgrade note in #3658 ("Upgrade cost: one re-key of stored ids for openai/responses/google lanes; #3644's reconcile tiers … absorb it without re-folding", and "the dsh/anthropic lanes take zero re-keying"). The Anthropic /v1/messages lane was affected, and on several sessions the reconcile tiers did not absorb the change.

Rolling back to 0.1.200 caused a second identical drift wave on every session's first request, so the 0.1.201 → 0.1.200 downgrade is not clean either. Some unmatched folds were lost permanently and could only be restored from a backup.

Conversation content was not lost: the host (OpenCode, compaction.auto=false) re-sends the full history every turn, and the unmatched folds reverted to the original messages. What was lost was the fold-to-message mapping, i.e. weeks of compression state per session, with large cost and latency increases.

Environment

Timeline (UTC, 2026-10-18)

Time Event
12:24–16:48 0.1.200 running normally. Zero resent history drifted lines in the log.
16:40:53 [update] installed 0.1.200 → 0.1.201
16:48:19 Restarted onto 0.1.201 (idle). No session traffic until 19:02.
19:02:05–19:27 First request of every session logs [fold-reconcile] resent history drifted (table below)
19:14:29 Main Anthropic session: [acp-usage] round 1 input=997959 cached=18468 (cache hit 2%) fold=new (previous turn: input 125906)
19:23:58 preflight compressed 14 range(s), ~70878 tokens saved (1080245 → 960163) in 503739ms → preflight aborted (the client disconnected during preflight compression)
20:56:10 After autoUpdate was set false on disk, the still-running 0.1.201 process re-installed 0.1.201 over a fresh manual 0.1.200 install (config change not picked up until restart)
21:01–21:06 Restarted onto 0.1.200. First request of every session drifts again (second table below)

First request after upgrading to 0.1.201

missing = covered ids missing; unmatched = re-entered the wire unfolded. Session ids truncated.

Session Lane Missing Re-anchored (how) Unmatched "tok unfolded in churn region"
f20302d59ffe /v1/messages 16077 10566 (1372 positional, 9194 toolCallId, 10 order breaks) 5511 ~1,122,474
f2d47fc7affe /v1/messages 10743 8254 positional 2489 ~92,406
ebae57880ffe /v1/messages 5451 4948 positional 503 ~81,874
ec3389da5ffe /v1/responses 24727 15454 (12102 positional, 2252 toolCallId, 1100 shape census) 9273 ~2,844,782
ee0bcfb25ffe — 33742 15146 (11719 toolCallId, 3424 shape census, 3 positional) 18596 (+31 suspected host-rewritten tool-call ids) —
ebf538502ffe /v1/responses 19826 19290 positional 536 ~53,751
eb97f1845ffe /v1/responses 16370 15834 positional 536 ~60,897
ec075c255ffe /v1/responses 16628 16505 positional 123 ~20,528
eb97f1846ffe /v1/responses 10474 10472 positional 2 ~62,238
ec3389d43ffe /v1/responses 26027 26027 positional 0 ~54,188
eb3f5e79dffe, eb3f5e65fffe, eb41a5099ffe, eb3f5db55ffe, eb4303d04ffe, eb4303ceaffe, eb549c932ffe, eb420d17effe, eb4303d23ffe /v1/responses 704–5795 all positional 0 14K–81K

On the next turns the unmatched remainder was reported again as covered id(s) missing with no anchor match — mutation … or client-side deletion/truncation (main session: 5511, then 3429 on every subsequent turn). The compression-conflict ledger recorded unannounced-rewrite — 3236/11610 incoming message(s) carry pre-turn refs of 14982 known, although nothing outside bili touched the history.

Input-token effect (last request before the upgrade → on 0.1.201): main session 125,906 → 997,959; eb41a5099ffe 176,409 → 350,796; eb420d17effe 98,609 → 157,349; eb4303ceaffe 45,146 → 82,594.

First request after rolling back to 0.1.200

Session Missing Re-anchored Unmatched
f20302d59ffe (/v1/messages) 14783 10376 (6886 positional, 3448 toolCallId, 42 toolCallId twin) 4407
ec3389da5ffe 23884 14934 8950, then 1775 more on a later turn (~1,008,485 tok unfolded; input 104K → 896K)
f2d47fc7affe 10743 8254 2489
ebf538502ffe 20405 19872 533
ec075c255ffe 16628 16505 123
others 1551–26295 all 0–2

Expected

An upgrade that changes message identity derivation should either migrate persisted fold state, or re-anchor all of it losslessly before the first forward. #3658 states this for exactly this release. If that is impossible, the release should be marked as needing a migration and held from auto-update (e.g. via the #3619 policy file hold/blocked), and the downgrade path should not re-churn.

Notes / suggestions

  1. Anthropic lane affected despite "zero re-keying" in [PR] protocol-stable core identity: same logical conversation, same ids in every dialect (#3642) #3658: positional re-anchoring covered only 1372 of 16077 in the main session; toolCallId did most of the work and still left 5511 unmatched.
  2. Re-anchoring degrades sharply on very long sessions with many unanchored blocks. Short sessions re-anchor 100% positionally; the 15K–34K-message sessions are where unmatched counts explode.
  3. Downgrade is also lossy: 0.1.201 persisted state under the new identities, so 0.1.200 sees a second churn. A one-time snapshot of fold state before the first request on a new identity epoch would make rollback safe.
  4. Emergency preflight stalls on drift: after a mass unfold, preflight folds of ~2.7K tokens each (0% shrink, cache ceiling ≥0%) for 504 s, which is the [resilience] Preflight compress/timeout loop on sustained mass fold-coverage loss has no graceful degrade #2438 shape.
  5. The pending image-identity change in Image message ids re-mint whenever an earlier image leaves the visible tail (membership-based ClusterCounter suffix) — prefix-cache breaks per fold, feeds #3748 storage growth #3751 says "existing image ids re-mint once" at upgrade. Given this incident, please validate that kind of one-time re-key against real long-lived persisted sessions (and the downgrade path) before release.
  6. advisoryCheck can force-install a target version even with autoUpdate: false. Operators who pin a version also need to know to disable it.

Frozen copies of the affected session state (legacy JSON + content stores) and the full proxy log are retained. I can run diagnostics or a reconcile replay against them if useful.

Activity

  1. ranxianglei commented on Oct 18, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    查重: 不重复 —— 按多组关键词检索过 open+closed(identity re-key / mass-unfold / covered id missing / downgrade churn),无既有同类条目。相关但不同:#3658 是引入该 identity 变更的 PR(本 issue 的源头,不是重复报告);#3751 是你 note 5 提到的另一个待上 image identity re-key 提案,后面会一起评估;#2438 仅被你的 note 4 引用为 preflight 症状形状。

    标签: bug + opencode + scope/kernel + p1(宿主是 OpenCode 2.0.28;失败域 = 上下文管理的 identity/reconcile 核心;严重度 = cache hit 崩坏导致成本爆炸 + 数周压缩状态丢失,正中 p1 定义)。

    版本钉定(version-first):tag 对照确认 kernel/src/wire/identity.ts(#3658/#3642 的规范 identity 模块)在 v0.1.200(kernel 0.0.131)不存在、v0.1.201(kernel 0.0.133)首次出现——id re-key 确实发生在 0.1.200→0.1.201 这一次升级,与你的时间线吻合,排除 #2847 那类版本误判。v0.1.200..v0.1.201 全窗 diff(37 文件,+2217/-394)里 identity 面就是 kernel/src/wire/{identity,openai,responses,google,bili-message}.ts + src/fold-reconcile.ts(+318)。

    初步层次判断(代码级验证进行中,结论随后):

    1. 「zero re-keying」在 [PR] protocol-stable core identity: same logical conversation, same ids in every dialect (#3642) #3658 评审期已被指出是 overclaim,措辞修了但没修干净。 anthropic lane 粒度确实零变化,但 toolCallId slot 退役出种子后,所有 lane(含 anthropic)的 tool-call/tool-result core 都会重铸 id。评审时已在 commit 6663f89 修正了表述,可发出去的 release notes 同一段里仍写着「Upgrade cost is one re-key of stored ids for openai/responses/google lanes」——与前一句自相矛盾。你的 note 1 成立:anthropic lane 受影响不是意外,是文档没兑现的承诺。
    2. 真正的缺口在迁移层,不在 codec 层。 bili 自己的 identity 函数变了,持久化的 fold 状态(covered ids / anchors / snapshots)却没有随之迁移,而是指望为「吸收宿主侧改动」设计的 reconcile tiers 去吸收它。你的数据显示这条路对长会话不成立:主会话 16077 个 missing 里 toolCallId channel 救回 9194,仍剩 5511 个 core 无任何通道可认领——具体哪些 core、为什么无通道,我正在对 src/fold-reconcile.ts 和 anthropic codec diff 逐条钉死(可用你冻结的会话快照做 replay 验证)。
    3. 降级再 churn 是这个设计下的必然,不是偶发。 0.1.201 第一次请求后就把状态以新 identity 落盘;回滚 0.1.200 后同一份内容推导出旧 id,等于第二次 re-key。持久化状态里没有任何 identity 纪元标记,两个方向的 drift 都只能走启发式 reconcile——而「bili 自己换了 key 函数」和「宿主改了历史」这两类 drift 本来就该分治:前者是确定性的(内容还在、新旧 codec 都在),应当确定性重算,不该进启发式。
    4. 两个独立子缺陷分开处理:note 4(preflight 在 mass-unfold 后每折 ~2.7K token、0% 收缩跑 504 s,[resilience] Preflight compress/timeout loop on sustained mass fold-coverage loss has no graceful degrade #2438 形状——早停守卫缺失)和 note 6(advisoryCheck 在 autoUpdate: false 下仍强制安装目标版本——pin 语义漏洞)。这两项修法不依赖上面的设计决策,会先修。

    下一步:① 钉死 5511 unmatched 的构成与机制;② 修复方向我倾向「持久化状态带 identity 纪元标记 + 纪元不一致时加载期做确定性 re-key 迁移(用存储的原始内容对新旧两套 codec 各算一遍,建 old→new 映射重写 fold 元数据)」而不是继续给 reconcile 加档——这涉及 kernel 侧与持久化格式,分析完成后我会给出选项对比请你拍板;③ 不依赖决策的部分(preflight 早停、advisoryCheck 语义)先开修。

    另外:你保留的冻结会话快照非常有用,若方便请提供(或告知获取方式),我打算用它做 re-key 迁移方案的回放验证,顺带把 5511 个 unmatched core 的构成一次性钉死。

  2. ranxianglei commented on Oct 18, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    分析完成:根因已定位并本地复现,修复方案待拍板

    一句话结论

    0.1.201 确实重铸了 anthropic 车道所有 tool-call/tool-result core 的 id(这点在 #3658 评审时已被指出「zero re-keying 措辞言过其实」,但发布的 CHANGELOG 行文仍自相矛盾)。但你主会话丢 5511 个 fold 的真正原因不只是 re-key——bili 侧有一个此前无人踩中的容量悬崖:fold 锚点持久化有 16384 的硬上限(MAX_ANCHORS,#2334 加的性能保护),超出上限的 covered id 只剩一条脆弱的再锚定通道(位置扫描),而位置扫描在累计 8 次失配后死亡。运行数周的长会话必然积累超过 8 次真实漂移(编辑/换模型/删除),于是 re-key 与漂移叠加成 mass-unfold。降级再次 churn 是对称的结构性问题:状态按新 id 落盘,旧版本看到的是又一轮 re-key。

    证据链(本地复现,非推测)

    我把两个版本的 codec + 完整对账引擎(v0.1.200/v0.1.201 源码提取 + src/fold-reconcile.ts v0.1.201 的 planReconciliation 全段,可直接执行)搭成了可运行的复现台,生成 OpenCode 形态的 anthropic 历史(3400 turns → 19374 cores,其中 17436 个 folded,越过 16384 上限),模拟 v0.1.200 稳态元数据后喂给 v0.1.201 解析 + 对账:

    场景 byPos byTool unmatched 说明
    A 干净历史 + 有上限 8252 0 0 历史干净的长会话即使越限也全部恢复
    B 轻漂移(40 处编辑)+ 有上限 5030 3223 9 9 个全是被编辑的 cell 本身(正确行为)
    C 重漂移(400 处编辑)+ 有上限 433 7329 660 byPos 从 8252 崩到 433 —— 你主会话的形状
    D 同 C 但去掉上限 433 7822 167 167 = 恰好是被编辑的 cell(108+24+35),只剩「真实漂移」

    关键事实:

    • v0.1.201 推导下,全部 tool-call/tool-result core 换新 id(旧 seed 内嵌 tool_use.id/tool_use_id,新 seed 去掉该槽位并对参数做规范化);text/thinking/image core 字节不变、id 不变。
    • 你的数据形状与此机制完全吻合:主会话 byPos 只有 1372、byTool 9194(窗口内的 tool core)、unmatched 5511(窗口外 + 位置扫描早死);而 responses 车道的短会话几乎全 byPos 恢复。绝对数量随会话长度与累计漂移量放大,方向一致。
    • 16384 上限在 0.1.200 之前就存在(perf: 长会话每次请求重复计算并丢弃超上限的压缩锚点 #2334 注释记录了当时的测算),不是本次升级引入的——但本次升级是它第一次遇到大规模 re-key,把它暴露了。这就是你 note 2 观察到的「短会话 100% 位置恢复、超长会话崩」的精确解释:不是长度本身,是长度 × 累计漂移越过了位置扫描的 8-gap 预算,且越限部分没有第二通道。

    层次判断

    • 表面现象:mass unfold → 输入 token 爆炸(126K→998K)→ 缓存命中崩塌 → preflight doom loop(note 4)。
    • 直接原因:bili「自己的 re-key」在长会话上对账通道不足。
    • 根因,两个独立缺陷:
      • R1 锚点窗口上限:MAX_ANCHORS=16384 把越限 id 静默降级为单通道恢复,且触发时无任何日志/告警。
      • R2 身份纪元切换无迁移层:bili 改了自己的身份函数(kernel 0.0.131→0.0.133),却依赖「宿主侧 churn」启发式来吸收自己的 re-key——没有纪元标记、没有确定性映射、降级结构性有损。[PR] protocol-stable core identity: same logical conversation, same ids in every dialect (#3642) #3658 CHANGELOG 里「openai/responses/google lanes」那句与同段前一句(tool cores still re-seed)直接矛盾,评审已指出、文案未修。
    • note 4(preflight 504s)= 既有失效域 [resilience] Preflight compress/timeout loop on sustained mass fold-coverage loss has no graceful degrade #2438(open,设计稿 F1/F2/F3 等你拍板),本事件是其第三个现场实例(proxy mode、升级触发),我会去那边补一条实例评论,不重复立项。
    • note 6 核实为代码事实:src/advisory.ts:337 advisory 强装路径硬编码 autoUpdate: true(搞一个自动强制更新,针对重大bug的版本 #1481 紧急回滚的刻意设计),且配置文件改动无热加载(只有 web UI 的 Apply 路径)——这是 20:56「我设了 autoUpdate:false 它还是重装 0.1.201」的直接原因。与本事件不同失效域,我会单独立项(带来源标记)。

    修复选项(请拍板)

    选项 A(推荐,无决策依赖,我现在就做):轻量锚点越过上限
    seed 循环在 16384 之后停止计算昂贵锚点(带 n/m/sh/wh 哈希字段),但继续为越限 id 创建零哈希的轻量锚点 {role, toolCallId}(O(1) 字段读取,内存 ~60B/id)。Pass 1 的 toolCallId 通道恰好只消费这两个字段,其余通道遇缺字段优雅退化。效果:任意长度的会话,tool core 都走协议级唯一的 toolCallId 通道再锚定,误配面为零(匹配纪律不变:每个 (id, role) 要求唯一未认领候选),升级/降级双向生效。残留:越限的非 tool core(image 等)仍靠位置扫描——anthropic 车道占比小,#3641 的 shape census 有部分兜底。

    选项 B(需拍板):调高或移除昂贵锚点上限
    覆盖所有 core 类型的越限恢复(含 image)。成本:每 pass 哈希工作量(#2334 的动机,当时实测 20k id ≈ 3616 次多余哈希,现代硬件可忽略)+ 持久化 JSON 每 id ~300B(17k 时约 5MB)。我的倾向:提到 65536 而非完全移除(保留 #2334 的意图,覆盖绝大多数实际会话)。具体数值你定。

    选项 C(需拍板,较大设计):身份纪元标记 + 持久别名表
    metadata 增加 free-form 字段 identityEpoch(kernel 身份推导每次变更即递增);纪元切换后的首个 pass 把 old↔new 配对结果固化为显式别名条目并持久(sticky),此后任何方向的纪元切换(升级/降级)都能经别名表映射回去——「降级 re-churn」从此结构性消失,也直接服务 note 5(#3751 的 image re-mint 发布前可用同一机制验证)。实现期发现的约束:完全离线确定性迁移目前做不到——状态里没有成员消息的原始字节(锚点只存指纹),离线 remap 要么引入字节留存(存储成本,与 #3049 交互),要么接受「首个过渡 pass 仍靠(被 A 强化过的)启发式配对,结果固化」。做不做 C、做到哪一档,是存储/产品取舍,你定。

    发版流程:0.1.201 已出,短会话不受影响(run A 证明干净长会话也全恢复),不建议 hold/block;建议 A(+B)快进 0.1.202。是否用 #3619 策略文件做事前拦截,是独立操作,听你的。

    结构化八问

    1. 是什么问题:升级到 0.1.201 后,fold 超过 16K core 的长会话批量失去再锚定能力,折叠消息原样涌回线上,输入 token 爆炸、缓存命中崩塌;降级引发第二轮同样现象。
    2. 什么原因导致的:R1(锚点 16384 上限悬崖)× R2(身份纪元切换无迁移层)叠加;re-key 本身在 [PR] protocol-stable core identity: same logical conversation, same ids in every dialect (#3642) #3658 部分披露过,但上限与位置扫描脆弱性的相互作用未被预测。
    3. 影响范围与严重程度:
    4. 怎么修复的:A=轻量锚点(机制如上);B=上限参数上调;C=纪元标记 + sticky 别名(+可选字节留存)。
    5. 回归风险:
      • A:只增 claims、不移除任何现有通道;误配面不变。有意行为变更披露:越限 tool core 从「仅位置单通道」变为「toolCallId 通道可用」(旧值:byPos-only → 新值:byTool+byPos)——这正是修复目标;持久格式向后兼容(旧版本读新格式锚点逐字段优雅退化)会在 PR 里验证演示。
      • B:每 pass 哈希量与持久体积上升(量化见上),无语义变化。
      • C:一个 free-form metadata 字段(非 schema 版本变更);若引入字节留存则存储增长显著,需单独评估。
    6. 是否破坏缓存:否。前缀缓存稳定性取决于线上字节(summary 载体、system 锚定),A/B/C 都不改任何线上字节;再锚定只改变哪些 id 计为 covered,折叠输出字节不变。
    7. 是否改了设计方向:A/B 不改(既有对账纪律增强);C 给状态语义新增「身份纪元」概念——是扩展不是转向,但触及持久化语义,属 §7.4 人工区,需你批准。
    8. 是否引入新配置:v1 均不引入(A/B/C 的常量都写死在代码,需要逃生口再走 owner-gated 配置流程)。

    行动清单

  3. ranxianglei commented on Oct 18, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    止血 PR 已开:#3753 —— #3753 #3752)。CI 在途,合并需要你。

    修复内容(Option A,lite anchors):MAX_ANCHORS=16384 窗口外的 tool core 现在持久化一个无 hash 的轻量锚点 {r, c, t, b}(角色、内容类、协议 toolCallId、文本长度)。Pass 1 的 toolCallId 通道恰好只消费这几个字段——任意长度会话的 tool core 都能再锚定,零新增哈希、零新增误配面(认领纪律不变:每个 (toolCallId, role) 唯一未认领候选)。窗口上限本身不动(#2334 契约原样),非 tool 的超窗 core 维持现状(positional-only)。回归测试 3 条(铸造形状 / 用 reconciler 自己的计数器证明走的是 toolCallId 通道 / 完整事故轨迹收敛回放),不带修复全红、带修复全绿;既有 16 个 fold-reconcile 相关套件 224/224 本地过,全量等 CI。

    诚实边界(必须说清):re-key 后的第一个 pass 行为不变——死区里的旧 id 在线上没有字节可配对,仍会有一次性 unfold(这正是你看到的 5511 那批);preflight 重折到新 id 后第二个 pass 账本即完整,此后该会话对 tool core 免疫(包括回退路径——只要降回旧版前跑过至少一个 fixed-build pass,旧版的 Pass 1 也能消费这些 {t,r} 字段)。要消灭首 pass 损失本身,需要 Option C(epoch 标记 + 粘性别名表),那是设计决策,等你拍板。

    八问:

    1. 是什么问题:超窗 covered id 只剩 positional 一条恢复通道,而它在积累 8 次漂移断点后必死——长会话上任何 id 重铸(升级/回退)都必然大面积 unfold。
    2. 什么原因导致的:perf: 长会话每次请求重复计算并丢弃超上限的压缩锚点 #2334 的性能护栏(避免每 pass 对溢出 id 重复哈希)被实现成了「直接丢弃」,且无任何告警日志;[PR] protocol-stable core identity: same logical conversation, same ids in every dialect (#3642) #3658 的 identity 变更又假设锚点账本完整,把 bili 自己的 re-key 交给为宿主侧 churn 设计的吸收层。两个机制叠加才成灾,单看任一个都不致命。
    3. 影响范围与严重程度:covered core >16384 且累计 >8 次真实漂移断点的长会话;严重度 p1(缓存命中崩塌→成本爆炸、周级折叠状态丢失),与你报告一致。
    4. 怎么修复的:见上——超窗 tool core 补一个零成本轻量锚点,让既有的 toolCallId 通道够得着它们;不动任何判定语义。
    5. 是否有回归问题:cap 内行为字节级不变(cap 逻辑未动,224 条定向测试钉住);norm-keyed 各通道对缺 n 的锚点显式跳过;image 通道本就不收带 t 的锚点;gap-tier order-bracket 对 lite 锚点新获得资格(同一受认可层级、同证据等级,PR 里已披露);降级兼容有一个已知残留(旧版读新版状态时,lite 锚点会被其 textless 谓词视为空文本族——完全围栏+精确计数的 ≤2 个连续 tool 单元理论上可被 k-th 配对,该层级本就没有角色检查),概率低、有界、仅限降级场景,PR 里逐字记录了,不在本 PR 修(那意味着改已发布代码路径)。
    6. 是否破坏缓存:否——线上字节不变,纯增量持久化,前缀缓存不受影响。
    7. 是否改了设计方向:否——order-centric 调和教义、per-cell 门控、honest-unmatched 全部原样;只是把锚点账本的覆盖形状补齐。方向级选项(B 提窗到 65536 / C epoch+别名表)仍是待决项。
    8. 是否引入新配置:无。

    其余处置:

    结论:止血已就绪待合(PR #3753);B/C 两项决策请求维持上一条回复的表述,等你拍板。

  4. ranxianglei commented on Oct 19, 2026

    @ranxianglei
    Owner

    为什么要有这个上限 怎么来的

  5. ranxianglei commented on Oct 19, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    问得好——这个上限的来历正好解释了为什么它会炸。

    是什么上限: MAX_ANCHORS = 16384(src/fold-reconcile.ts:166)——持久化锚点表(foldAnchors)的大小上限。每个 covered id 存一个锚点,里面带约 5 个摘要字段(归一化身份 sha256、去 toolCallId 的 norm、simhash 词草图 ×2、turn key),单条几百字节。

    怎么来的: 它是个防御性存储护栏,不是设计出来的工作集。引入时的注释就是全部设计文档(src/fold-reconcile.ts:164-165):

    "Anchors are only kept for covered ids; 16k covered messages is far beyond any folded session, the cap only bounds pathological metadata."

    即当时判断"16k 远超任何真实会话",上限只为挡病态膨胀。它早于 #2334 就存在(v0.1.187 已可见);#2334/#2338(10-07)没改这个值,只把执行点从「先全量构建再删超限」改成「构建到 16384 即停」——修的是每请求重复计算被丢弃锚点的性能问题(20k-id 会话每请求白付 3616 次 SHA256,函数级 A/B 中位数 171.6ms → 29.6ms)。

    为什么现在错了: 前提被证伪了——你的会话 covered id 是 21k–34k,"far beyond any folded session" 不成立。超窗的 id 从此静默失去全部非位置通道(无警告日志),只能靠 Pass 0 位置扫描兜底;而位置扫描在一侧超过 8 个 resync gap(MAX_RESYNC_GAPS)就死——长会话积累的正常漂移轻松击穿它,于是大面积 unfold。两层参数各自都"合理",组合起来在长会话上是断崖。

    PR #3753 怎么处理这个上限: 不动 16384 本身(#2334 的性能性质保留——昂贵哈希预算不变),但超窗的 tool core 额外记一个零哈希 lite 锚点(只存 role/contentType/toolCallId/text 长度四个现成字段,O(1)),让 #3641 的 toolCallId 通道在窗口外继续可用。非 tool core 超窗后仍是位置-only,这是诚实残留;如果你想让所有类型都有窗口外通道,那就是待决策项 B(把昂贵锚点上限提到 65536,代价:持久化 ~+6MB/34k id + 一次性 mint 成本)。

    另:CI 那边 windows shard 一个测试超时(flake 证据已核,同测试两小时前 master 基线 windows 上通过,本地 9/9 绿),已重跑,结果出来我在本线程报。

  6. ranxianglei commented on Oct 19, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    CI 收口了,PR #3753 现在全绿可合:#3753

    windows 超时的定性(不是本 PR 的回归):

    • 失败形态是 testTimeoutFailure(恰好 10000ms 超时),不是断言失败;同文件其余测试在同一 shard 上各 ~3s 通过;
    • 失败测试 tests/plugin-terminal-usage.test.ts(responses lane 计费观测)与本 PR diff 零交集(diff 只有 src/fold-reconcile.ts + 新测试 + CHANGELOG,该测试不 import 也不触及 fold-reconcile);
    • 同一测试两小时前的 master 基线 run 在 windows-latest 上通过(ok 1696);本地 head 上 9/9 绿(~32s);
    • 重跑后两个 windows shard 均通过。

    过程透明说明:最初 push 触发的 pull_request 矩阵被随后的 label 同步事件(scope=skip)按并发组取消了——这是 ci.yml 注释里记录过的 #3688 label/merge 竞态,不是代码问题;我先 workflow_dispatch 补跑(core 矩阵,遇到上述 flake),flake 排除后给 PR 打了 ci:full 标签补上 branch protection 要求的完整 12-leg 矩阵(ubuntu/windows × node22/24),12/12 + 全部静态门禁 success。

    待你处置:

    1. 合并 PR [PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753(lite 锚点止血:tool core 超窗后保留 toolCallId 通道;非 tool core 超窗仍位置-only,诚实残留);
    2. 决策项 B(昂贵锚点上限 16384→65536?)与 C(identity epoch 迁移,防首次升级 pass 的单次 unfold)维持我之前回复中的选项表述,等你拍板;
    3. [no-dispatch] Pinned installs get surprise reinstalls: advisory force-install ignores autoUpdate:false, and config-file changes only take effect on restart #3754(advisory 强装绕过 autoUpdate:false + 配置无热载)已立 [no-dispatch],不阻塞本 PR。
  7. ranxianglei commented on Oct 19, 2026

    @ranxianglei
    Owner
  8. ranxianglei commented on Oct 19, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

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

    看了 #3759(已合):这是渲染层的根治——出站前缀改由服务端正史渲染,身份 re-key 从此不再影响线上字节与缓存。它直接覆盖了我此前列的 Option C(epoch 标记+别名表):C 撤回,状态侧不需要再做纪元迁移层,#3759 让线上字节与身份推导解耦了。

    但 #3753(lite 锚点止血)与 #3759 是两层,不互相替代,建议两个都合:

    1. [PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 在灰度门后(默认 0%)。 rollout 完成前所有用户仍暴露在原事故形状下,[PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753 是那段时间唯一的保护。
    2. snapshotRender 开着时,fold 状态仍然依赖 reconcile 认领。 [PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 自己写明「reconcileFoldCoverage 仍观察客户端视图(观测与渲染分离)」——渲染信任的是块的 seq/signature 覆盖集,但块的生死仍由 reconcile 决定:FOLD_DRIFT_ESCALATE_PASSES=3(src/fold-reconcile.ts:205)连续多数丢失 pass 后块被 reapDestroyedSubstrate 删除([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)。没有 [PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753,re-key 后超窗 tool id 每 pass 都认领不了 → 老块的 z 计数确定性累积 → 3 pass 后块被删 → 块没了,snapshot 渲染器无东西可抑制,内容照样 unfold 回线上。即:[PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 保线上稳定,[PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753 保基质存活,基质没了渲染器没有可渲之物。
    3. 降级保护:[PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753 的 lite 锚点 {r,c,t,b} 字段旧版 Pass 1 原样消费(降回旧版前跑过一个 fixed-build pass 即安全);[PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 在更老版本里根本不存在。
    4. 共存成本:零冲突(仅 CHANGELOG 重叠,已解为两条并存)。[PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753 已 rebase 到当前 master(b4e5b11,即 [PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 合入后),typecheck 干净,定向套件 116/116 绿,含 [PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 新增的 snapshot-render 套件——两机制共存无干扰已实测。CI full 矩阵在途(ci:full 标签保留)。

    八问(决策项:#3753 保留还是按 superseded 关闭)

    1. 是什么问题:渲染层根治([PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759,已合)与状态层止血([PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753,open)的关系如何处置。
    2. 什么原因导致的:同一根因(identity re-key)的两个损伤面——线上字节面([PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 覆盖)vs fold 状态账本/块存活面([PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753 覆盖)。
    3. 影响范围与严重程度:
    4. 怎么修复的:[PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753 维持原 PR 设计(超窗零哈希 lite 锚点,只补 toolCallId 通道,认领纪律不变)。
    5. 是否有回归问题:相对 rebase 前评审无新增(cap 逻辑未动、纯增量持久化);唯一新变量是与 [PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 代码共存,已由 116/116(含其 7 条)实测验证。
    6. 是否破坏缓存:否(两者都不改任何线上字节,[PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 本身改善缓存稳定性)。
    7. 是否改了设计方向:[PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 把渲染数据源从客户端重发改为服务端正史(你已定的方向,已合);[PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753 不改方向。我的 Option C(epoch 迁移)因被 [PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 取代而撤回。
    8. 是否引入新配置:[PR] fix: hash-free lite fold anchors for past-cap tool cores (#3752) #3753 无;[PR] Snapshot rendering: proxy lane outbound prefix rendered from server-side canonical history; existing sessions immune to | 快照渲染:proxy 车道出站前缀从服务端正史渲染,存量会话对内核升级免疫(#3756) #3759 引入 BILI_ROLLOUT_SNAPSHOT_RENDER/rollout feature(你的 PR,CONFIGURATION.md 已记)。

    结论:建议两个都合——#3759 管线上,#3753 管基质,合起来才是 id-churn 家族的闭环。若你判断 snapshotRender 会很快 100% 放量、且接受窗口期基质侵蚀风险,说一声我关 #3753;否则等 CI 绿后合并即可。

  9. 6 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions