Repository navigation
[PR] test(restart): CI regression — compressed state survives + cache prefix stays stable after repeated kill/restart (#5631) | test(restart): 反复杀死重启后压缩状态存活+缓存前缀稳定的 CI 回归(#5631) - #5635
Conversation
…kill/restart with cache-prefix stability (#5631) Drive dsh-shape (chat-completions) and pi-shape (anthropic) clients at a real child-process proxy. Turn one loads a far-over-window raw history (~6MiB by default) into a 16k-token wall -> deterministic digest fold on first contact; then SIGTERM/SIGKILL/clean-shutdown x2 cycles against the same session id and storage tree. Asserts: outbound stays under 512KiB after every restart (fold state survived), canonical prompt prefix stability >=50% (same threshold as the real-model gate Lane A), and fold evidence on disk at cycle end. A second no-fold control arm (10M-token wall) proves discriminative power: without compression the full multi-MB fiber passes through unchanged every turn. No new config surface (only existing compress.modelContextLimit / BILI_CONFIG_FILE / x-acp-session), no kernel changes. The suite is registered in scripts/live-files.mjs (append-only tail). Locally green: dsh + pi lanes, ~27s.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.8167-pr.5635.436d4cfThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5635.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 我按失败签名(scope-split gate / Triage 三步(bug 类)
一个我要明确 flag 的点:这是默认行为变更——已有 user-scope pi-subagents 安装的用户,升级后 acp_delegate 会从「保持活跃」变成「自动 stand-down」。我认为这是修正有害行为(两套竞争路由 + 永久 schema/prompt token),且逃生口已就位,所以按 bugfix 推进实现并在 PR 里显式披露旧值→新值;如果你希望更保守(比如先加个过渡开关),告诉我即可。 我开始实现了:两处代码 + 回归测试(user-scope 不注册工具 / |
(ai: vllm-qwen/qwen3.8-27b) **修好了 → PR: https://github.com/ranxianglei/billion-context/pull/5640**(Closes #5637) 标签: 先澄清一句:转发里那条「Fixed in #5638」我核过 git——当时没有任何提交或推送,这条是我从零做到现在才落地的 PR。
结构化八问
验证:工作树原本落后 master 806 提交,已重打基线到当前 master( 判定:可进 review。因改了默认行为(§7.4 属产品决策),不走 auto-merge,等人工合并;CI 结果出来我再跟一句。 |
(ai: vllm-qwen/qwen3.8-27b) 收工确认:#5637 已落地为 PR #5640(Closes #5637),上面那条带八问的回复是完整结论,这里只补一句状态。
|
(ai: vllm-qwen/qwen3.8-27b) 状态更新(这轮重新唤醒我核了 PR 的 CI,发现并处理了一个红): #5637 的修复本体早已落地为 PR #5640(fix commit CI 曾红在 但推送前发现分支上已经有一个内容完全一致的 lock-sync commit( 当前 CI(head |
… comment + changelog (no model-family gate exists)
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
APPROVE(判定)— 注:本 lane 凭据为 PR 作者身份,GitHub 不允许自批,故以 review-comment 形式落此结论;合并权在 owner。 — 纯测试 PR,方向正确、断言有牙,关键论断逐条对代码独立复核过,修复后本地复跑全绿。
结构化八问
- 是什么问题:CI 里缺「代理反复杀死重启后压缩状态存活 + 出站缓存前缀稳定」的自动化回归断言——此前只有手工真模型门禁(bili-gate Lane A/B)覆盖,任何让磁盘态或前缀渲染在重启边界漂一下的改动只能等真跑门禁才看得见。
- 什么原因导致的:不是缺陷而是覆盖缺口——重启边界行为从未被 hermetic 测试钉住。
- 影响范围与严重程度:纯新增测试,对产品行为零影响;补的是覆盖洞(此前该类回归在 CI 不可见)。
- 怎么修复的:两条 lane(dsh 形 openai wire / pi 形 anthropic wire)驱动独立子进程代理,用既有
compress.modelContextLimit硬墙(16k)逼出确定性 digest 折叠(fiber 超限 ~90x,深居 #2383 emergency regime),零 LLM 调用;按 SIGTERM/SIGKILL/干净停机混合序杀进程 5 次(sigterm×2、sigkill×2、clean×1),每次以同一会话 id + 同一存储树全史重发续跑;主臂断言每轮出站 ≤512KiB + canonical prompt LCP ≥50%(与 gate Lane A 阈值对齐);控制臂(10M 墙永不折叠)断言 ≥0.9× 原文字节穿透钉死判别力(#3617 双向门控纪律)。 - 是否有回归问题:无。diff 只碰
tests/issue5631-restart-survival.test.ts(新文件)+scripts/live-files.mjs表尾登记 + CHANGELOG 条目;无 src/、无 kernel/、无 pi-subagents/、无 version、无新增配置面键(compress.modelContextLimit、update.checkIntervalMs、BILI_CONFIG_FILE、x-acp-session均为既有)。既有行为逐项清点:请求管道 / 持久化格式 / wire 形状 / 缓存与重试策略——全部未触碰。 - 是否破坏缓存:不涉及任何缓存失效策略;套件本身就是跨进程边界前缀缓存稳定的回归钉。
- 是否改了设计方向:不涉及。
- 是否引入了新的配置:无产品配置;仅 3 个测试自用 env(
RESTART_SURVIVAL_FIBER_BYTES默认 6MiB clamp 1–32MiB /RESTART_SURVIVAL_TMO默认 480s /RESTART_SURVIVAL_DUMP=<dir>调试落盘)。
验证记录(独立复核,非照抄 PR 描述)
[deterministic digest]标记确实进入持久化的 block summary(src/preflight.ts:1610/1665;persist.zstd 默认 false → plain JSON 可扫;断言口径与 tests/preflight-emergency-fold.test.ts:143 一致)✅EMERGENCY_FOLD_COVERAGE = MAX_PREFLIGHT_ROUNDS×2×CHUNK_FRACTION = 19.2x,fiber 超限 ~90x 深居确定性 regime,无需 LLM 调用 ✅POST /__bili/shutdown(#3544)、GET /__bili/health、x-acp-session身份链、tests/tmp-rm.ts的 rmrf、scripts/ci-pretest-cache.mjs均存在且语义吻合 ✅- CHANGELOG 条目落在 Unreleased→Added 正确小节;LIVE_FILES 表尾登记与 #2816 哨兵兼容(CI 静态门全绿)✅
- 修复后本地复跑:pass 3 fail 0(~37s:dsh 20s + pi 17s)✅
已顺手修(均已提交本分支,非阻塞发现,全部机械性小修)
- 已顺手修:测试注释 + CHANGELOG 里「claude-* 走 side-request passthrough(#388)绕过压缩」的论据与代码事实不符——#388 门控只按客户端证据武装(agent 头 / 输出预算 ≤200 / 宿主 sidecar 形状,src/server/side-request.ts + handle.ts:1037),从不按模型家族判定,故任何模型 id 都留在主压缩路径;两处措辞改为真实理由(中性 id 让套件不依赖 claude 注册表/窗口表条目)+ commit d33848b
- 已顺手修:
RESTART_SURVIVAL_DUMP未设时每次上游命中都执行必然失败的mkdirSync("")+writeFileSync("/up_*.json")(虽被 catch 但属每请求噪声)→ 未设时直接跳过 + commit 62105a2 - 已顺手修:控制臂改用独立 UpstreamRecorder——
lastPrompt仅按 URL 建键,共享 recorder 会让控制臂首个 LCP 基线落在主臂最后一轮 prompt 上(当前是无人读取的死数据,属未来维护陷阱)+ commit 1d13fd1
判定:可合并(人工合并)。issue #5631 第②部分(bili-gate docker 真模型 restart lane)按 PR 声明不在本 PR 范围、走仓库边界另行交付,符合拆分约定。
(ai: vllm-qwen/qwen3.8-27b) Review 收工:PR #5635 判定 APPROVE(lane 凭据为作者身份、GitHub 禁自批,结论以 review-comment 落在 PR:pull/5635#pullrequestreview-5772837774);已顺手修 3 处非阻塞小修并推回分支(d33848b 注释/CHANGELOG 的 #388 论据纠错、62105a2 dump 未设时的无效 syscall、1d13fd1 控制臂独立 recorder),修复后本地复跑 pass 3 fail 0(~37s);无 kernel/配置面/行为变更,等 owner 合并。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
复审(head 1d13fd18e):APPROVE 判定不变 —— 新 head 相对首审 head(eac1e53e1)的增量恰好是上一轮 review 里列出的三个顺手修 commit,无其他任何改动:
1d13fd18e fix: give restart-survival control arm its own upstream recorder
62105a201 fix: skip debug-dump syscalls when RESTART_SURVIVAL_DUMP is unset
d33848bdc fix: correct #388 side-passthrough rationale in restart-survival test comment + changelog
增量只碰 tests/issue5631-restart-survival.test.ts(+19/-8)与 CHANGELOG 一句话;无 src/、无 kernel/、无配置面、无 version。
八问(本轮仅答增量,未变项沿用上一轮完整审核)
- 是什么问题:不涉及新问题——本轮是顺手修后的复审。
- 什么原因:不涉及。
- 影响范围与严重程度:三处均为测试文件内机械修正(措辞纠错 / 去无效 syscall / 控制臂 recorder 隔离),产品行为零影响。
- 怎么修复的:见上三个 commit,逐一如上轮描述。
- 是否有回归问题:无——修复后在同一棵树上全量重建并本地复跑该套件:pass 3 fail 0(~37s,build-info 确认 dist 出自
1d13fd18e)。 - 是否破坏缓存:不涉及。
- 是否改了设计方向:不涉及。
- 是否引入新配置:不涉及(仍是那 3 个测试自用 env,默认值未动)。
CI(镜像缓存,head 1d13fd18e):failed 0;静态门 + test 矩阵在队列中运行,转绿即达可合并状态。
判定:维持 APPROVE(本 lane 凭据为作者身份,GitHub 禁自批,结论照旧以 review-comment 落地;合并权在 owner)。
(ai: vllm-qwen/qwen3.8-27b) 复审收工(head |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1030-master.c41ad31 # this exact build
npm install -g billion-context@master # always the newest merged build
|
(ai: vllm-qwen/qwen3.8-27b) 你这条转发内容只有「ework」,没有新指令,我就当连通性探测处理,不额外开工;顺手把最新状态报一下: PR #5640 的 CI 现在全绿了。 head 所以 #5637 的修复本体 + lock-sync 都已就绪,就差你 review/合并。因为改的是默认行为(user-scope 安装现在也会让 |
…mpress gate, ranxianglei#5686 dsh drift consolidation, ranxianglei#5696 model-scoped keyring 429 Ride-along upstream work that landed after c9ba485: - ranxianglei#5683 forbid unprompted / out-of-bounds compression - ranxianglei#5686 dsh drift consolidation (last native-compaction leak window) - ranxianglei#5696 model-scoped KeyRing rate-limit holds - ranxianglei#5661 incremental-lane credential headers, ranxianglei#5656 single-shot sidecar - ranxianglei#5644 watcher registration recovery, ranxianglei#5635 restart survival Overlap with this lane is limited to regenerated artifacts (CONFIGURATION*.md) and to the shared relay/core seams, both auto-merged. No source conflict. Verified after rebuilding kernel: issue5175 58/0, tag-echo 79/0, issue2190-degen-close 32/0, golden-storage-render 5/0, storage-engine-proofs 12/0, native-compact-terminal 1/0, plugin-passthrough-tag-strip-chat 20/0, plus the newly arrived ranxianglei#5683/ranxianglei#5686/ranxianglei#5656/ranxianglei#5658/ranxianglei#5631/ranxianglei#5641 suites all green. tsc clean, four gates clean, config docs a fixed point.
这是什么 / What
新回归测试:把代理进程反复杀掉再拉起来(
kill -15/kill -9/ 优雅停机,各×2,共 5 次),验证长会话的压缩状态在进程边界存活、出站前缀保持稳定(缓存可命中)。Closes #5631。此前这条路径只有手工真模型门禁(bili-gate Lane A/B)覆盖,CI 里没有任何自动化断言——任何一次让磁盘会话态或折叠渲染在重启边界漂一下的改动,都要等真跑门禁才能发现。
怎么测的 / How
一个测试文件
tests/issue5631-restart-survival.test.ts,两种客户端线形各跑一条 lane:/v1/messagesgpt-testtest-anthropic-model(非 claude 族:claude-* 走 side-request passthrough #388 绕过压缩,是既有行为)每条 lane:
POST /__bili/shutdown→ SIGKILL → SIGTERM):每次杀后以同一会话 id + 同一存储树重启子进程、全史重发续跑;max_tokens等信封字段,对原始 JSON 算 LCP 会得到 0.2% 假阴性,而 tokenized prompt 前缀才是上游 prefix cache 的真实键);判别力控制臂(#3617 gate 双向断言纪律):第二实例用 10M-token 巨窗,永不折叠——若主臂的「≤512KiB」能通过,只可能是客户端作弊;控制臂同时断言每轮 ≥0.9× 原文字节原样穿透,证明套件在压缩失效时必然红。
范围声明 / Scope
compress.modelContextLimit/BILI_CONFIG_FILE/x-acp-session);scripts/live-files.mjs(append-only 表尾);tests/index-entry-guard.test.ts:dist 缺失/stale 时按需自建,CI 上常跑不 skip;验证 / Verification
本地(CI preload 链逐字同款):
另过:
npm run typecheck、node scripts/check-test-import-graph.mjs、SPAWN_RE 哨兵(已登记 live-files)。全量判决以远端 CI test 道为准。可调旋钮(env,仅测试自身,非产品配置面):
RESTART_SURVIVAL_FIBER_BYTES(默认 6MiB,clamp 1–32MiB)、RESTART_SURVIVAL_TMO(默认 480s)、RESTART_SURVIVAL_DUMP=<dir>(调试用 per-request 落盘)。bili-gate 侧(后续跟进)
issue #5631 的另一半是 bili-gate docker 门禁里加真模型 restart lane(真 dsh headless
--session-id/ 真 pi 反复 kill)。本 PR 先落 CI hermetic 半边;gate 侧改动在非 git 项目目录~/projects/bili-gate,按仓库边界单独交付。