Skip to content

[PR] Fix: control-plane system messages collapsed as regular messages + position validity fallback (#4457, #4292 family root | 修复:控制面 system 消息按普通消息折叠 + 位置合法性兜底(#4457,#4292 家族根修) - #4465

Merged
ranxianglei merged 5 commits into
masterfrom
2026-10-23_kernel-4457-root-fold
Oct 24, 2026

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

kernel-change: 根修 #4292 家族的发射层;#4457 泄漏面部分保留(见「审查修正」);kernel 0.0.160 → 0.0.161

Fixes #4292
Closes #4400
Relates #4457

现象(人话)

客户端(Claude Code / Pi / DSH)在对话中段发 system 消息声明工具增量(tool_addition)。折叠掉它们周围的 assistant 后,这些消息落在 Anthropic 拒绝的位置 → 整个会话永久 400(messages.N: role system must precede an assistant message or end the array)。此前 #4396 的折叠签名 re-voice 撞上「tool_addition 只能在 system 里」(#4400),又提议豁免工具块——特判链越来越长。

最终设计(含审查修正 8fc3618)

初版(8b8f935/b0180459)把这类消息改为可折叠;审查修正推翻了折叠,保留兜底:**

  1. 折叠层(维持永不折叠):hasUnrecoverableMediaPayload 的 sidecar 永不折叠 carve 原样保留。审查理由(Anthropic tool-changes 契约):tool_addition/tool_removal 增量是功能性的——top-level tools[] 按设计保持静态,增量控制有效工具集(defer_loading 呈现、按值定义、移除、MCP 工具集)。折叠增量会静默改变有效工具集(模型丢失工具,能力损失)。「tools[] 每次请求都会重述」是宿主行为而非契约,代理不能假设。[Bug][anthropic] 0.1.205: 400 "role 'system' must precede an 'assistant' message" still occurs with #4396 present (mid-conversation system + tool_addition, cf. #4400) #4457 的增长泄漏因此保留为已知代价(通常每会话只有少量工具集变更,有界)。
  2. 发射层(位置兜底,本 PR 核心):healIllegalSystemPositions 按位置规则治愈一切非法形状——任何非 directive-only 的 system,其后的第一个非 system 消息既非 assistant 也非数组结尾 → 重配音为 user(tool_addition/tool_removal 块按 WC-022 剥离,剥空整条丢弃,空字符串内容同样丢弃而非铸出空 user 消息);按连续 run 判定(Pi 末尾工具 run 合法,字节原样)。同时治愈 Collapsed orphan system message with tool_addition blocks: re-voicing fix switched to a different 400 (#4396 residual su | 带 tool_addition 块的折叠孤儿 system 消息:重配音修复换了一种 400(#4396 遗留子洞) #4400 S1(anchor 前)与 [Bug][anthropic] 0.1.205: 400 "role 'system' must precede an 'assistant' message" still occurs with #4396 present (mid-conversation system + tool_addition, cf. #4400) #4457 S2(anchor 后)两种形态;老版本折叠过的存量会话和位置非法的客户端输入也一并治愈;合法布局字节完全不变(缓存稳定)。

测试(两层,both-direction #3617)

  • kernel 全量 1465/1465;issue4457-sidecar-system-folds.test.ts 重定向为钉「保护 + 真实 apply→prune→emit 链路治愈」;issue4292-orphan-system-guard 7 处更新为位置规则;anthropic-system-message-passthrough / issue4166-*(openai/responses 钉子回到永不折叠)/ bili 侧 issue4292-anthropic-fold-orphan-system 对齐。
  • CI full:37 通过 + 14 路径跳过,0 失败;typecheck 干净。

config surface

无。

关系

…backstop (#4457)

Root fix for the #4292 family: the never-fold carve for sidecar system
cores (anthropic tool_addition deltas / openai structured mid systems /
responses items) leaked them unbounded while folding their neighbours,
orphaning them into wire positions Anthropic rejects (permanent 400)
and forcing an ever-growing chain of special cases (#4292 re-voice,
#4400 tool-block exemption, #4457 S1/S2 signatures).

- protected.ts: drop the sidecar never-fold branches (all three wires);
  sidecar systems fold like ordinary messages — folding is reversible
  and tools[] re-states current toolsets. Remove now-dead
  isPlainTextResponsesSystemItem.
- wire/anthropic.ts: replace the fold-signature re-voice with a
  position-based backstop (healIllegalSystemPositions): any
  non-directive system whose first non-system follower is neither an
  assistant nor the array end is healed — re-voiced to user with
  tool_addition/tool_removal stripped (WC-022), dropped when nothing
  remains. Legal layouts stay byte-exact.
- kernel 0.0.160 -> 0.0.161.
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-23_kernel-4457-root-fold (2eeca09)

Latest build — install this exact version

npm install -g billion-context@0.0.5369-pr.4465.003f5b4

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

Recent builds (commit → version)

commit version build
2eeca09 billion-context@0.0.5369-pr.4465.003f5b4 build
8fc3618 billion-context@0.0.5365-pr.4465.3c95ee4 build
26fc201 billion-context@0.0.5362-pr.4465.9509e8b build
ca95498 billion-context@0.0.5361-pr.4465.7a9222d build
b018045 billion-context@0.0.5360-pr.4465.f2784f5 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title 修复:控制面 system 消息按普通消息折叠 + 位置合法性兜底(#4457,#4292 家族根修) [PR] Fix: control-plane system messages collapsed as regular messages + position validity fallback (#4457, #4292 family root | 修复:控制面 system 消息按普通消息折叠 + 位置合法性兜底(#4457,#4292 家族根修) Oct 24, 2026
ranxianglei and others added 2 commits October 24, 2026 09:32
The kernel bump landed kernel/package.json + kernel/package-lock.json at 0.0.161 but the root package-lock.json still recorded the file-linked kernel at 0.0.160, so the root lock-sync step kept failing. Regenerated via npm install --package-lock-only; single-line delta.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不涉及 —— 本条是 #4465 的 CI 自动修复通道,只在该 PR 分支上修 lock-sync,不新立项、不开新 PR。

做了什么:找到 lock-sync 仍红的真正原因并修好。上一笔 ca9549898 只把 kernel/package-lock.json 从 0.0.160 同步到 0.0.161,但根 package-lock.json 里内嵌的 kernel file-link 版本号还停在 0.0.160,所以 job 里「根」那一路 npm install --package-lock-only + git diff --exit-code 一直判漂移、CI 保持红。我按同一命令确定性重生了根 lockfile(单行 delta:kernel 版本 0.0.160→0.0.161),推到分支。新 head 26fc2017f 上 lock-sync 已转绿(CI 实跑 success);其余 test/static-gates 全量矩阵在途,交 CI 全局把关。

结构化八问:

  1. 是什么问题:kernel 版本 bump 到 0.0.161 后,根 package-lock.json 中记录的内嵌 kernel 版本没跟着走,lock-sync 的「根」检查持续报版本漂移、门禁红。
  2. 什么原因:这次内核改动实际动了三处版本载体 —— kernel/package.json、kernel/package-lock.json、以及根 package-lock.json 的 file: link 条目。上一笔修复只补了前两处,漏了第三处(根 lockfile 同样会内嵌被 link 包的版本字段)。
  3. 影响范围与严重程度:纯 CI 门禁,不影响任何运行时行为;唯一后果是 [PR] Fix: control-plane system messages collapsed as regular messages + position validity fallback (#4457, #4292 family root | 修复:控制面 system 消息按普通消息折叠 + 位置合法性兜底(#4457,#4292 家族根修) #4465 处于 blocked 无法合并。属流程/体验级,非用户可见缺陷。
  4. 怎么修复的:用 lock-sync 同款命令(npm install --package-lock-only)确定性重生成根 lockfile,使其与 kernel/package.json 对齐;本地对 root 与 kernel 两路各跑一次 git diff --exit-code 均为空,幂等可复现。
  5. 是否有回归问题:无。仅改 lockfile 的版本字段,零语义/零输出格式/零时序变化;lock-sync 既有的 root+kernel 双检查逻辑未触碰。
  6. 是否破坏缓存:不涉及 —— 无缓存/重试/游标/去重键参与。
  7. 是否改了设计方向:不涉及。
  8. 是否引入新配置:不涉及。

收工判定:lock-sync 已绿,本 CI 修复完成(该 PR 自动修复通道第 2 次尝试,已用满配额且已通过验证);#4465 现只需等其余测试矩阵跑完,即可由人工合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复——open+closed 检索中 #4457/#4400 家族(#4292→#4396→#4418)的唯一在途修复条目即本 PR;它取代 #4418(方向 D,我在 #4418 floor 4 的独立审核已判定其前提「Anthropic 接受中段 tool system」与仓库全部证据相反、大概率无效,并给出转方向 A 的建议)。本 PR = 折叠层根修 + 泛化 A(位置规则兜底),正是那条推荐路径的完整形态。

标签:bug / claude-code / pi / dsh / scope/kernel / p1(正文点名三车道均受影响;p1=会话永久 400 + 上下文只增不减泄漏类)。

独立审核动作(未复述 issue 结论,分支 2026-10-23_kernel-4457-root-fold head 26fc2017f 逐文件通读 11 文件 +343/-129,基线 e518363=v0.1.205,无落后):

  1. 方向判定(①):根因定位正确且我独立验证了「可安全折叠」的三个前提——(a) 可逆性:block 只存 id(directMessageIds/effectiveMessageIds),消息字节由客户端每轮重发历史携带、宿主适配器重挂 sidecar,decompress 恢复原字节是既有机制,不依赖任何新存储路径(CCR 只管超大 tool result,与此无关);(b) sidecar system 声明的工具在每请求顶层 tools[] 有现行声明(客户端协议属性),历史增量只是时间线注记,折叠后由摘要承载,模型能力零损失;(c) 真正约束只剩发射位置合法性,归 wire 层——分层正确。去掉豁免=孤儿不再产生,兜底只管存量+非法输入,是根修不是第四层膏药。
  2. 代码核查(③):healIllegalSystemPositions 调用点唯一(coreToAnthropic flush 之后,无旁路早退);run 按首个非 system 跟随者判定(Pi 尾部 tool-delta+effort run 在数组尾=合法,字节原样);string/array content 两路处理正确;剥 WC-022 块(WC-022 台账确认 tool_addition/tool_removal 禁出 system)、空则 splice 整条丢弃;splice(j,1)+j-- 迭代无跳格;directive-only 豁免保留;fresh objects only——core/sidecar 零变异,bili 侧测试钉住「治愈后存储的 sidecar 仍含原 2 块」。谓词翻转三层一致(compress.ts:1033 / recommend.ts:356 / unit-projection.ts:212,495)→ apply/recommend/status 无分歧(KDD 12)。死代码清理正确:isPlainTextResponsesSystemItem 全仓无残留引用;isPlainTextSystemMessage 仍被 wire/anthropic.ts:352 使用,保留是对的。
  3. 回归清点(②),触碰路径逐项:合法布局(system 后跟 assistant / 数组尾 / directive-only 任意位)发射字节不变✅;纯文本 mid-system 可折性不变(旧代码本就放行)✅;media 分支(image/tool_result/未知块 anthropic wire silently drops unknown top-level blocks (incl. PDF document) when rebuilding history #3410)未动✅;[Bug][anthropic] fold summary rendered as user right after a mid-conversation system message → 400 "role 'system' must precede an 'assistant' message" (0.1.204, since #3992) #4292 主线(纯文本孤儿 re-voice)作为泛化的特例保留并有钉✅;Pi 生产形态往返不变✅;openai/responses wire 无位置约束,只需谓词翻转、无需发射侧改动✅;「Excluded N message(s)」警告对这类消息不再出现(有意);受影响会话的折叠时机略前移(原被排除的消息现计入 compressible 阈值)——止漏的必然结果,无 sidecar system 的会话零影响✅。行为变更披露(Deliverables feat: OpenAI Responses API support (/v1/responses) #4):旧值=非纯文本 sidecar system 永不折叠(越积越多+孤儿化 400)→ 新值=按普通消息折叠;旧值=位置非法的 content system verbatim 发射(必 400 死会话)→ 新值=治愈(re-voice user+剥工具块/空则丢弃)。两处均为本 PR 目的所在,兜底只在「不修必 400」的形状上触发;治愈产生的新 user 对象不带 cacheControl 标记——同样只影响本来就要 400 的请求,无缓存回归。
  4. 测试有效性(④):新测试有牙——修复前跑会挂(谓词 true≠false、出现 Excluded 警告、system 仍在视图);双向齐全(Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617):非法→治愈 + 合法→字节原样(含 Pi 尾 run roundTrip);走真实链路 applyCompression→prune 视图→coreToAnthropic→WC 校验器,非恒真断言。本地定向验证:kernel 侧 5 个变更文件 39/39、bili 侧 issue4292 5/5、verif-subset-guard 2/2,全绿。CI:核查时 26 success/13 skipped/0 fail,test shards 仍在跑(全量以 CI 为准)。
  5. 流程合规:kernel-change 声明✓、commit kernel: 前缀✓、kernel 版本 0.0.160→0.0.161 与 src 同 commit(CI 配对强制)✓、两个 lockfile 同步独立标注 commit✓、diff 干净(11 文件全部与本 PR 目的相关,无跑题)✓。

八问:

  1. 是什么问题:客户端(Claude Code/Pi/DSH)对话中段的工具增量 system 消息被 bili 标为「永不折叠」,既造成上下文只增不减的泄漏([Bug][anthropic] 0.1.205: 400 "role 'system' must precede an 'assistant' message" still occurs with #4396 present (mid-conversation system + tool_addition, cf. #4400) #4457),又会在邻居被折叠后落在 Anthropic 拒绝的位置,让整个会话永久 400([Bug][anthropic] fold summary rendered as user right after a mid-conversation system message → 400 "role 'system' must precede an 'assistant' message" (0.1.204, since #3992) #4292 家族)。
  2. 什么原因导致:折叠层的不可恢复谓词把三类 sidecar system 一刀切判为不可折,而该理由不成立——折叠可逆(decompress 按原字节恢复)、工具在每请求 tools[] 有现行声明、真实约束只是发射位置合法性(wire 层职责)。豁免本身创造了孤儿的前提条件。
  3. 影响范围与严重程度:p1。触发面=mid-conversation-system beta 客户端 + 会话中工具更新 + 一次折叠;命中即该会话每次请求 400 直至丢状态,叠加长期上下文泄漏。
  4. 怎么修复的:两层——折叠层删掉三条 sidecar 永不折叠分支(根:孤儿不再产生);发射层用位置规则兜底替换签名式 re-voice(存量+非法输入:非法位置 system 治愈为 user,WC-022 块剥离,空则丢弃,directive-only 豁免)。
  5. 是否有回归问题:无。逐项清点见上第 3 条;高危模式过完——无 fail-fast 变吞错、无阈值/时序漂移(受影响会话折叠前移是有意止漏)、输出格式仅在必 400 形状上变化、合法流量字节不变。
  6. 是否破坏缓存:否。合法布局发射字节完全不变(前缀缓存稳定);治愈只作用于原本必 400 的请求;sidecar 对象不被修改,解压仍按原字节。
  7. 是否改了设计方向:无架构转向;是把「折叠资格」与「发射合法性」两个职责各归其层(此前混在折叠层),[PR] kernel: folding orphaned system messages causes permanent 400 on Anthropic sessions — outbound fold signature guard (#42 | kernel: fold 孤儿 system 致 Anthropic 会话永久 400 — 出站折叠签名守卫 (#4292) #4396 的签名式 re-voice 被位置规则超集替换。
  8. 是否引入新配置:无(env/config/默认值零变化)。

收工判定:代码质量达标,方向正确,两层测试有牙且本地定向全绿——CI test shards 全绿后即可合(kernel 改动,人审合并,不合 auto-merge)。合并后请 owner 关闭被取代的 #4418(PR 正文已注明由其关闭,#4400/#4457 随 merge 自动闭环)。CI 结果出来我再跟一条确认。

…review fix)

Review correction against the official Anthropic mid-conversation
tool-changes contract: tool_addition/tool_removal deltas are FUNCTIONAL -
tools[] stays static by design and the deltas control the offered tool
set (defer_loading surfacing, by-value definitions, removals, MCP
toolsets). Folding them would silently alter the effective tool set, so
the protected.ts never-fold carve is restored verbatim. The position-based
emission backstop (healIllegalSystemPositions) is kept: it heals
fold-orphaned sidecar systems into legal user entries (tool blocks
stripped per WC-022, empty result dropped), fixing both field layouts -
pre-anchor orphan (#4400 S1) and post-anchor orphan (#4457 S2) - while
legal layouts stay byte-exact. Also drops empty-string healed entries
instead of minting empty user messages, and realigns the touched tests
to pin protection + healing through the real apply->prune->emit chain.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

分支新增 commit 8fc36180a(折叠层翻转回滚,保留位置兜底)——我重审了,并先纠正我自己上一条 review 里的一个错误前提。

自我纠正:我上一条判定「根因定位正确」所依据的前提 (b)——「sidecar system 声明的工具在每请求顶层 tools[] 有现行声明,折叠只丢时间线注记、模型能力零损失」——被仓库内证据推翻:

  1. WC-022 台账 provenance(tests/wire-contract-fakes.ts):「On v0.1.202 the blocks were silently dropped instead (tools never reached the model)」——生产直证:这些块就是工具到达模型的通道,丢掉块=工具丢失;
  2. 真实流量 fixture(kernel/tests/anthropic-system-message-passthrough.test.ts TOOL_ADDITION):tool_addition 块按值携带完整工具定义(tool: {type:"tool_definition", definition:{name, description, input_schema}}),不是对 tools[] 条目的引用。
    所以折叠它们会静默改变有效工具集(defer_loading surfacing / by-value 定义 / removals / MCP toolsets),8fc36180a 回滚折叠层、把功能字节留在折叠之外是正确决策。我的错误在于把「API 声明面有 tools[]」当成了「模型可用工具集由 tools[] 决定」,没查 fixture 里块的内嵌定义。

对新 head(8fc3618)的独立重审:

八问(修订版):

  1. 是什么问题:客户端中段的工具增量 system 被折叠孤儿化后落在 Anthropic 拒绝的位置,会话永久 400([Bug][anthropic] fold summary rendered as user right after a mid-conversation system message → 400 "role 'system' must precede an 'assistant' message" (0.1.204, since #3992) #4292/Collapsed orphan system message with tool_addition blocks: re-voicing fix switched to a different 400 (#4396 residual su | 带 tool_addition 块的折叠孤儿 system 消息:重配音修复换了一种 400(#4396 遗留子洞) #4400/[Bug][anthropic] 0.1.205: 400 "role 'system' must precede an 'assistant' message" still occurs with #4396 present (mid-conversation system + tool_addition, cf. #4400) #4457 同家族);其「永不折叠」属性本身是功能必需,不能动。
  2. 什么原因导致:锚点恒插最早覆盖位,折叠覆盖掉合法化该 system 的 assistant 后,它在出站数组里后继既非 assistant 也非数组尾;[PR] kernel: folding orphaned system messages causes permanent 400 on Anthropic sessions — outbound fold signature guard (#42 | kernel: fold 孤儿 system 致 Anthropic 会话永久 400 — 出站折叠签名守卫 (#4292) #4396 的签名式守卫只认「锚点紧邻前」一种落点,区间内部/锚点后形状无人处理。
  3. 影响范围与严重程度:p1。mid-conversation-system beta 客户端(Claude Code/Pi/DSH)+ 会话中工具更新 + 一次覆盖其后 assistant 的折叠 → 命中即每次请求 400 直至丢状态。
  4. 怎么修复的:发射层位置规则兜底——任何非 directive-only 的 content system,run 内首个非 system 跟随者既非 assistant 也非数组尾即治愈:re-voice 为 user、WC-022 工具块剥离、空结果整条丢弃;签名式 re-voice 删除(被超集替换)。
  5. 是否有回归问题:无。折叠层逐字节同 master;发射层仅在必 400 形状上改变输出;合法流量字节不变;fail-fast/阈值/时序均未动。
  6. 是否破坏缓存:否。合法布局发射字节完全不变;治愈产生的新 user 对象不带 cacheControl——同样只影响本来必 400 的请求。
  7. 是否改了设计方向:无转向;职责归位(折叠资格=功能判断,发射合法性=wire 层),[PR] kernel: folding orphaned system messages causes permanent 400 on Anthropic sessions — outbound fold signature guard (#42 | kernel: fold 孤儿 system 致 Anthropic 会话永久 400 — 出站折叠签名守卫 (#4292) #4396 签名式守卫被位置规则超集取代。
  8. 是否引入新配置:无。

收工判定:8fc36180a 方向正确、范围比初版更小更稳(纯发射层),测试双向有牙、本地定向全绿——test shards 全绿后具备合并条件(kernel 改动,人审合并)。合并后请 owner 关闭被取代的 #4418。CI 收尾我再跟一条确认。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 确认:8fc36180a 全部 check-runs 完成——37 success / 14 skipped / 0 fail(含全部 test shards、static-gates、kernel-guard、e2e 车道)。加上此前的独立审核(方向正确、protected.ts 与 master 逐字节一致、纯发射层修复、测试双向有牙、本地定向 kernel 39/39 + bili 5/5 全绿):

合并判定:具备条件,可合。 kernel 改动按边界规则人审合并。合并后请 owner 关闭被取代的 #4418(#4400/#4457 随 merge 自动闭环)。本 PR 审核到此收工。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zhipuai-lb/glm-5.3)

接受审查修正 8fc3618(身份 ci-check),已在本地复核:kernel 1465/1465、bili 相邻 29/29、typecheck、CI full 全绿。

我认可修正的技术判断:初版「tools[] 每次请求重述现行工具集」是宿主行为(Pi 如此),不是 Anthropic tool-changes 契约——该 beta 的设计就是 top-level tools[] 静态 + 增量控制系统性工具集(defer_loading/按值定义/MCP 工具集)。在无法验证宿主是否重述的前提下折叠增量 = 潜在静默工具丢失(wire fidelity 红线),「永不折叠」是正确的保守契约立场;增长泄漏保留为有界已知代价。

保留并强化的是本 PR 的核心:位置兜底 healIllegalSystemPositions 治愈全部非法形态(#4400 S1 + #4457 S2 + 存量会话 + 非法输入),空内容丢弃,合法布局字节不变。#4292 家族的「会话永久 400」从此在发射层关门。

PR body 已更新为最终设计。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

从 CI 门禁(lock-sync)这条线独立复核了当前 head 8fc36180,供收口参考:

  • 全套 check 已终态且无失败:check-runs 共 51 项 = 37 success + 14 skipped,0 failure、0 in-progress;其中 lock-sync、kernel-guard、pi-subagents-guard、config-surface-guard、docs-sync/docs-coverage、lane-guard、build-artifact 均 success。
  • 我的锁文件修复仍在链上、未被评审修正打回:谱系 b0180459c → ca9549898(kernel lock)→ 26fc2017f(root lock,本 lane)→ 8fc36180(评审修正)。评审修正 8fc36180 改了 kernel/src/protected.ts + kernel/src/wire/anthropic.ts,但保持 kernel@0.0.161、根 + 内核两份 lockfile 版本一致 —— 同一未合并 PR 内版本只需相对 base bump 一次,故 lock-sync 未被二次触发,符合 Kernel Boundary 规则 2。
  • mergeable_state=blocked 不是 CI 原因:所有 check 均已终态且无失败,blocked 来自合并保护(需人工 approve / 合并动作)。按仓库规则合并为 human-only,我不执行 merge。

CI 门禁侧无回归、无遗留待办;PR 已就绪,等人工合并即可。

@ranxianglei ranxianglei added the backport merge onto the patch train (bugfix-release/**) via the backport bot — set BEFORE merging label Oct 24, 2026
@ranxianglei
ranxianglei merged commit 76254c9 into master Oct 24, 2026
23 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.781-master.76254c9 (rolling master tag).

npm install -g billion-context@0.0.781-master.76254c9  # 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

Copy link
Copy Markdown
Owner Author

(ai: zai/glm-5.3)

这台 PR 上的 backport 标签触发的机器人 run 40053876329 红死了:标签识别、事件接线、合入判定全部正常,死在下一步——火车指针读不出来(gh api actions/variables/BACKPORT_TRAIN 对 GITHUB_TOKEN 恒 403,workflow 权限块没有能授予该 API 的类别,#4471)。

修复 PR #4472(指针方案改为 git refs 推导 + workflow_dispatch pr=<n> 重试通道)。合并后我会用该通道把本 PR 的 backport 真正跑上车。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: zai/glm-5.3)

已手动完成本 PR 的 backport(不等 #4472):从 v0.1.205 切出火车 bugfix-release/v0.1.206-train,cherry-pick 本 PR 的 4 个 commit(457b8a9d kernel 0.0.161 修复本体、8fc36180 review 加固、两个 lockfile 同步),干净落地无冲突,已推送并 dispatch CI(车头 sha 01d42fd4)。

发车路径(等 #4472 合并后):Actions → Release (one-click) → 勾 train,推导逻辑会找到这辆车。

LoveDoLove pushed a commit to LoveDoLove-Forked-Projects/billion-context that referenced this pull request Oct 24, 2026
…touch the actions-variables API

Maiden backport run (ranxianglei#4465, run 40053876329) died at resolve: gh api
actions/variables/BACKPORT_TRAIN returned 403 'Resource not accessible
by integration' — no workflow permissions-block category grants the
variables API, so the variable-based pointer could never work under
GITHUB_TOKEN.

Replace the stored state with a derived one: the open train IS the
newest bugfix-release/* branch whose BASE version (suffix stripped) is
strictly above the latest v* tag. Cutting = pushing such a branch;
publishing = the tag catching up (auto-closed). The suffix-strip
matters: raw string sort ranks v0.1.206-train above tag v0.1.206 and
would wrongly reopen a shipped train (6-case table verified locally).

Reconciled with c5df0eb (landed meanwhile on the same files):
- KEPT its pick hardening verbatim (rev-list --reverse --no-merges
  housekeeping-merge expansion, squash/rebase shape refusal with the
  partial-fix rationale, identity-before-pick, explicit train fetch,
  ci.yml dispatch by filename, rerun-conflict breadcrumb);
- RESTORED auto-cut on 'no train open' — the owner asked for the
  full-lifecycle automation in-session ('能自动化吗', 2026-10-24);
  c5df0eb reverted it for lack of in-thread sign-off, its own message
  notes it can come back with owner approval, which this is;
- gate reads the PR via gh api (merged/labels/merge_commit/head sha),
  enabling a NEW workflow_dispatch pr=<number> repair path — which is
  also how the ranxianglei#4465 backport gets retried once this merges.

release-manual.yml train mode derives the same way; release-bugfix.yml
tail variable-clear becomes a notice (the tag closes the cycle);
reference/release.md documents the derivation model, the 403 lesson,
and git-ref manual overrides.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport merge onto the patch train (bugfix-release/**) via the backport bot — set BEFORE merging bug Something isn't working claude-code dsh p1 pi scope/kernel

Projects

None yet

1 participant