Skip to content

[PR] fix(#4516): degraded direct fallback — add the missing oversize refusal, self-heal retry, and transition logging - #4546

Merged
ranxianglei merged 15 commits into
masterfrom
2026-10-24_pi-direct-fallback-guards
Oct 26, 2026
Merged

ranxianglei merged 15 commits into
masterfrom
2026-10-24_pi-direct-fallback-guards

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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

Closes #4516

What this changes

The gateless native lanes (pi/omp/opencode-V1) had none of the safeguards their siblings carry when the proxy goes away. The field report: a 1,063,850-token raw history (window 500,000) rode straight to the provider after a failed cold start, every retry 502'd, and the only trace was one warn line in bili.log. All three contracts now live in the SHARED intercept (src/agent/native-intercept.ts) so every lane gets them:

  1. Oversize refusal on the direct fallback — directSendOrRefuse now prices every body before a degraded send, using the doom math hoisted out of dsh (media-aware two-stage pricing, DSH's unattributed over-limit gate prices base64 images as text (bytes/4) — media-heavy requests are falsely rejected wi | dsh 无归属超限门把 base64 图片当文本计价(bytes/4)——媒体重的请求被假拒 422,上游本会正常接受 #4111 direction; Context Window Overflow Issue Summary: Raw Requests Sent Directly to Upstream Rejected + Local Intercept Cooldown Lockin | 上下文超窗问题汇总:请求裸冲上游被拒 + 本地拦截冷却锁死会话(统一分析入口) #4079 floored bar; fail-open on missing data). Provably-oversized bodies get a local 422 (x-bili-gate: oversize-refusal-fallback, retryable, wire-shaped per dialect) instead of a guaranteed upstream rejection.
  2. Self-heal — a request that finds no live origin fires the owner's singleFlight respawn under a 15s cooldown, then holds out for the in-flight attempt under state.spawnWaitMs ?? readyTimeoutMs ?? 15_000. The pi spawn lane sets SPAWN_BUDGET_MS + 10s, so a slow cold start (Boot full-scan of historical corpus: 3.9 GB store cold start at 34 s+ → hits the 60 s hard budget on native spawn → inev | 启动 boot 全量扫描历史语料:3.9GB store 冷启动 34s+,撞上 native spawn 的 60s 硬预算 → 必然降级直连(随后以未压缩历史撞上游窗口) #4515) is waited out instead of refused at the generic cap. A failed bootstrap no longer means direct-for-process-lifetime; recovery needs no host restart.
  3. Transition logging — every proxy/direct/refused TRANSITION logs exactly one line (the old one-shot warned flag is gone); state.lastUnavailableReason carries bootstrap-failed vs dead into the refusal wording so users can tell "still starting" from "died".

dsh keeps its gate-facing signature (a wrapper decodes init.body); the hoisted functions are re-exported so existing importers/tests are untouched. TECHNICAL-NOTES.md gains the degraded-fallback contract section.

Behavior changes (old → new)

# Old New
① Gateless lanes sent provably-oversized bodies direct during degraded mode → guaranteed upstream prompt is too long Local 422 refusal with floor/core/window numbers + reason; bodies that FIT or where window/body is unknown still go direct exactly as before (fail-open)
② Failed bootstrap = direct for the whole host process lifetime; only a host restart recovered Per-request respawn retry under a 15s cooldown; first request always fires (no cooldown on round 1), concurrent requests share one singleFlight attempt
③ Readiness wait capped at a generic 15s (readyTimeoutMs had no assigner repo-wide) while spawn budget is 60s Pi spawn lane waits SPAWN_BUDGET_MS + 10s (70s) on the retry path — slow cold starts are waited out, not refused

Note on ①: the local bar never assumes a window below 1M tokens (#4079 policy, unchanged from dsh's gate): declared sub-1M windows are printed in the message but the floored bar governs, since declared windows can be wrong-small and an undersized byte guard false-blocks. Bodies between a sub-1M declared window and 1M are left to preflight, same as dsh today.

Tests

New tests/issue4516-pi-direct-fallback.test.ts (11 tests, hermetic XDG_STATE_HOME like the selfheal suite): both wire shapes of the refusal, fits-passes-direct, no-header fail-open, media core-fits vs core-over (#4111 direction), self-heal recovery with transition logs, cooldown single-attempt under concurrency, slow-cold-start waited-out (pins the #4515 shape), once-per-transition logging, dead-vs-bootstrap wording split.

Targeted local runs all green: new suite 11/11; native-intercept-selfheal + native-intercept + dsh-native + pi-native 136/136; remaining intercept-touching suites 241/241; typecheck clean. Full-suite verdict left to CI on this head.

Deferred (decision item, out of scope here)

Extending the panel attribution surface (src/server/admin.ts /__bili/plugin/attribution) beyond dsh to pi/opencode/omp lanes — tracked as a follow-up decision per the issue discussion.

@ranxianglei ranxianglei changed the title fix(#4516): degraded direct fallback — add the missing oversize refusal, self-heal retry, and transition logging [PR] fix(#4516): degraded direct fallback — add the missing oversize refusal, self-heal retry, and transition logging Oct 24, 2026
…ersize refusal, self-heal retry, transition logging

The gateless native lanes (pi/omp/opencode-V1) had none of the safeguards
their siblings carry when the proxy goes away: a provably-oversized raw
history rode straight to the provider (1.06M tokens vs a 500K window in
the field report), a failed bootstrap meant direct-for-process-lifetime,
and the only trace was a single warn line. All three contracts now live in
the shared intercept so every lane gets them:

- size arm on directSendOrRefuse: the doom math is hoisted out of dsh into
  the intercept (media-aware two-stage pricing #4111-direction, #4079
  floored bar, fail-open on missing data); provably-oversized bodies get a
  local 422 (x-bili-gate: oversize-refusal-fallback, retryable,
  wire-shaped per dialect) instead of a guaranteed upstream rejection.
- self-heal: a request finding no live origin fires the owner's
  singleFlight respawn under a 15s cooldown and then holds out for the
  in-flight attempt under state.spawnWaitMs ?? readyTimeoutMs ?? 15s — the
  pi spawn lane sets SPAWN_BUDGET_MS+10s so a slow cold start (#4515) is
  waited out instead of refused at the generic cap. Recovery needs no host
  restart.
- announce: every proxy/direct/refused TRANSITION logs exactly one line
  (the old one-shot warned flag is gone); state.lastUnavailableReason
  carries bootstrap-failed vs dead into the refusal wording.

dsh keeps its gate-facing signature (a wrapper decodes init.body); the
hoisted functions are re-exported so existing importers and tests are
untouched. TECHNICAL-NOTES.md gains the degraded-fallback contract section.

Behavior changes vs past releases:
1. Gateless lanes now REFUSE locally (422) what provably cannot fit the
   window while degraded — previously such bodies were sent direct and
   died at the provider. Bodies that fit, or where the window/body is
   unknown, still go direct exactly as before.
2. A failed bootstrap is retried per request under a 15s cooldown instead
   of staying down until the host process restarts.
3. The pi spawn lane waits SPAWN_BUDGET_MS+10s (70s) for readiness on the
   retry path instead of the generic 15s cap.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。 open+closed 全量按症状/机制检索(direct fallback / oversize refusal / respawn self-heal / transition logging):只有本 PR 引用 #4516,无并行工作。相邻但不重叠:#4539(修 #4515 boot 侧——pre-listen 语料全量扫描撞 SPAWN_BUDGET_MS,即「spawn 为什么死」)与本 PR(#4516 fallback 侧——「死了之后怎么办」)互补,合起来才是该现场事故的完整闭环;#4158/#4121(opencode direct-refusal 的 media 排除)是本 PR doom math 的上游来源,不是重复。

标签: bug, pi, scope/wiring, p2(与源 issue #4516 triage 对齐:缺陷类、pi 车道、协议接线域;p2 = 特定条件触发[proxy 不可用 × 历史超窗]且有绕行,非核心路径停摆)。注:本条 [PR] 镜像条目在 Gitea labels API 上返回 404(仅 /labels 列表端点可达),无法通过 API 落标,标签判定在此报备。

状态说明:这是 agent-authored PR(正文自报 vllm-qwen/qwen3.8-27b),按 [PR] 流程审核中——已拉分支逐段读完 diff 并对照 master 验证关键机制。一个需要 owner 知情的现状:分支当前 mergeable_state: dirty,唯一文本冲突在 src/agent/dsh-native.ts;根因是 master 在本 PR 分叉后又落了 #4158(2a3934fce),把 mediaBytesOfWireBody 抽到了新模块 src/agent/media-bytes.ts,而本 PR 把同一个 walker 复制进了 native-intercept.ts——冲突解决必须做去重(保留 master 的 media-bytes.ts 为唯一实现,native-intercept 改为 import),纯文本 union 会留下两份漂移副本。conflict-worker-N-r1 自 12:34Z 起在处理 rebase,我不并行推同一分支。定向测试跑完后按八问给完整审核结论。

@ranxianglei
ranxianglei force-pushed the 2026-10-24_pi-direct-fallback-guards branch from 11538bf to bc50f1a Compare October 24, 2026 14:32
@ranxianglei ranxianglei added bug Something isn't working p2 pi scope/wiring labels Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-24_pi-direct-fallback-guards (90c0c75)

Latest build — install this exact version

npm install -g billion-context@0.0.5995-pr.4546.2560f04

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
90c0c75 billion-context@0.0.5995-pr.4546.2560f04 build
34e6186 billion-context@0.0.5934-pr.4546.2cbc40a build
5b8424d billion-context@0.0.5539-pr.4546.00bb0d0 build
bc50f1a billion-context@0.0.5518-pr.4546.344c19c build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解决并 rebase 到最新 master(ba5ab0bce),分支已 force-push,head bc50f1a87,merge state 已转干净(mergeable: true)。除文本冲突外还发现并处理了一个 git 没报的语义冲突和一条遗留红测试,详见八问。

1. 是什么问题
PR 分支与 master 冲突:双方都把 mediaBytesOfWireBody 从 dsh-native.ts 搬了出去,但搬到了不同文件——master(#4111 后续整理)搬到新建的 src/agent/media-bytes.ts,本 PR 搬到 src/agent/native-intercept.ts。自动合并把两份定义都留下了(git 只报了 dsh-native.ts 一个文本冲突,重复定义是语义冲突,不解决就是重复标识符直接编译不过)。另外 rebase 后发现 master 上有一条旧测试红了,经 A/B 验证(rebase 前 head vs master 各跑一遍):rebase 前的 PR head 就已经红——不是本次 rebase 引入的。

2. 什么原因导致的

  • 冲突:同一函数被两条产线各自"搬家"到不同目的地,合并时没有交集可消解。
  • 测试红:本 PR 的 self-heal retry 是有意移除「degrade 后整个进程生命周期内不再重试 respawn」这条旧不变量(代码注释原话:"a failed spawn used to mean direct-for-process-lifetime"),但 PR 没有同步更新钉住旧不变量的 master 测试 tests/native-intercept.test.ts(install: failed respawn degrades…)——该测试断言第二次请求后 respawns === 1,而新语义下冷却门放行后会再次尝试(respawns === 2)。

3. 影响范围与严重程度

  • 冲突解法本身:纯归并去重,零运行时行为变化,无用户影响。
  • 测试修正:零运行时行为变化,只是让断言对齐 PR 已实现的行为。
  • 真正的行为变更是 PR 自己的设计(见第 4 问),非本次冲突处理新增;PR 描述未显式披露这条旧不变量的移除,此处按规则补披露。

4. 怎么修复的

5. 是否有回归问题
本地:typecheck 干净;定向套件全绿(issue4516-pi-direct-fallback / dsh-native / native-intercept / native-intercept-selfheal / pi-native,185/185)。逐项过过的既有行为:onGiveUp 在 repeated direct 请求下仍只触发一次(新断言钉死);dispatch 序列 rewrite→direct→direct… 不变;#1957 respawn 探测/冷却路径未被触碰(其套件绿);oversize 拒绝路径(doom math 搬家前后同函数体)行为等价。全量回归以远端 CI 为准。

6. 是否破坏缓存
不涉及。respawn 冷却是会话内内存态,不动任何缓存/游标/去重键。

7. 是否改了设计方向
不涉及。完全保持 PR 原有设计,冲突处理没有引入任何新的架构决策。行为变更披露(补 PR 之缺):旧值 = proxy bootstrap 失败或 send-failure give-up 后,model 流量直发且永久不再重试 respawn;新值 = degraded lane 每 RESPAWN_COOLDOWN_MS(15s)由后续 model 请求驱动重试一次 owner bootstrap,直到恢复(单飞+冷却限流)。这是 #4516 的 intended 变更,可用性优先(代理活了流量自动回到压缩车道),但 PR 原文未声明它移除了 permanence 不变量,特此明示。

8. 是否引入了新的配置
不涉及。无新 env/config/默认值。

收工判定:分支已就绪可审,等 CI 全量结果;若 owner 认为「give-up 后也允许 self-heal」这个广度需要收窄(仅限 bootstrap 失败场景),那是 PR 自身逻辑的一行级调整,可在 review 中拍板。

…send

Review nit from the #4546 review: the recovery-retry path built `restamped`
but dispatched with `stamped.init` (and read outgoing headers off
`stamped.init`). `withHeaders` returns an `.init` that is a pure function of
only (`init`, `extra`) - never of its first argument - and both calls pass the
identical `init` + `routedExtra`, so `stamped.init` == `restamped.init` in every
branch. Provably no behavior change; this just makes both dispatch arguments
come from the same `restamped` binding for readability.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

#4546 review 完成。结论:代码扎实、无阻断项,建议新 CI 波次转绿后合并。 一个行为决策项留给 owner(不影响可合并性)。

我顺手做的(小问题直接修):native-intercept.ts routed-retry 路径建了 restamped 却用 stamped.init 发送——逐分支核实 withHeaders 返回的 .init 只依赖 (init, extra)、与第一个参数无关,两处调用传入相同的 init+routedExtra,故 stamped.init ≡ restamped.init,是可证明的无行为差异可读性瑕疵。已就地修为独立 refactor: commit(5b8424d2c),定向套件重跑 185/185 绿、typecheck 干净。新 head 的 11 个 CI workflow 已排队。

结构化八问:

  1. 是什么问题:bili proxy 冷启动失败或会话中途死亡后,gateless native 车道(pi/omp/opencode-V1)回退成「模型请求直发上游」,但缺了兄弟车道 dsh 有的三道保险——无 oversize 判定(历史超窗仍照发、必被上游拒)、无自愈(bootstrap 失败 = 整个进程生命周期直发、只能重启恢复)、转换日志只打一次(分不清「还在起」还是「死了」)。现场证据:一个 pi 会话 106 万 token 裸历史(窗口 50 万)冷启动失败后直发上游,每请求 502,bili.log 只有一行 warn。

  2. 什么原因导致的:这三道保险原本只写在 dsh-native.ts 里;共享 intercept 抽出 directSendOrRefuse 时只保留了 When the proxy goes down, incremental rounds fall back to direct connection, sending the incremental payload as-is to upstream and causing a 400 (same mechanism across opencode/omp/dsh-native). | 代理挂掉时增量轮次降级直连会把增量载荷原样发给上游导致 400(opencode/omp/dsh-native 同一… #3304 的 payload 还原,size 判定 / 自愈 / 日志从未共享出去;pi 车道不注册 takeoverGate,dsh 式 refuse 对它永不生效;它的 respawn 又只在 recover()(需已有 origin)里被调,bootstrap 失败即永久直发。

  3. 影响范围与严重程度:只影响用这三条 native 车道、且 proxy 恰好起不来或中途死掉的用户;正常运行(proxy 活着)完全不触发。触发时该会话模型请求整体失败(oversize 者)或落入「直发但不压缩」态,需重启 host 才恢复——属「能用但特定条件下坏、有绕行(重启/开新会话)」,与 [pi] Direct connection fallback after proxy disconnect: no oversized rejection, no self-healing, no visible alerting (al | [pi] 代理失联后的直连兜底无 oversized 拒绝、无自愈、无可见告警(opencode/dsh 都有)—— 1.06M token 原始历史被直接送进上游 #4516 的 p2 一致。

  4. 怎么修复的:把三道契约上提到共享 intercept、全车道受益——① degraded 发送前做 media-aware 两段定价(DSH's unattributed over-limit gate prices base64 images as text (bytes/4) — media-heavy requests are falsely rejected wi | dsh 无归属超限门把 base64 图片当文本计价(bytes/4)——媒体重的请求被假拒 422,上游本会正常接受 #4111 方向、Context Window Overflow Issue Summary: Raw Requests Sent Directly to Upstream Rejected + Local Intercept Cooldown Lockin | 上下文超窗问题汇总:请求裸冲上游被拒 + 本地拦截冷却锁死会话(统一分析入口) #4079 floored bar ≥1M、缺数据 fail-open),provably-oversize 的 body 给本地 422(retryable、按方言 wire 形状)而非发给上游必拒;② 找不到活 origin 时按 15s cooldown 触发 owner 的 singleFlight respawn、再在 spawnWaitMs 下等它(pi 车道设 70s,容忍 Boot full-scan of historical corpus: 3.9 GB store cold start at 34 s+ → hits the 60 s hard budget on native spawn → inev | 启动 boot 全量扫描历史语料:3.9GB store 冷启动 34s+,撞上 native spawn 的 60s 硬预算 → 必然降级直连(随后以未压缩历史撞上游窗口) #4515 式慢冷启动);③ 每次 proxy/direct/refused 转换恰好打一行日志(废弃一次性 warned flag),reason 区分 bootstrap-failed / dead / busy-exhausted 并进入 refusal 措辞。

  5. 是否有回归问题:逐项审过,无意回归——

    • oversize arm 纯增量:能装下或 window/body 未知的 body 仍照旧直发(fail-open);dsh gate 侧签名与 import 面不变(wrapper + re-export)。
    • 有意行为变更(已披露):旧不变量「bootstrap 失败/give-up ⇒ 进程生命周期直发、永不重试」→ 新「请求驱动 respawn 重试、15s 一次直到恢复」。这正是本 PR 目的,worker 已在 floor 6 披露;steady-state 节奏受 singleFlight + 15s cooldown 约束,不会堆叠 spawn。
    • 一个决策项:recover() 触发 respawn 时不写 lastRespawnAttempt ledger,故会话中途死亡后下一请求会立即重试 bootstrap(不等 15s)。我判断这是 defensible by design(singleFlight 防堆叠、立即重试 = 更快恢复)。若 owner 想把自愈范围收窄到「仅 bootstrap-fail」,是一行级调整。我的推荐:保持现状(可用性优先、有界)。
    • transition 日志只在 degraded 路径传 degradeLog,正常直发流量不翻状态;日志量按转换次数有界。
    • 断言旧「永久 degrade」不变量的既有测试已被 worker 更新为双向钉住新语义(Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 纪律:cooldown 开→会重试;cooldown 关→不堆叠)。
  6. 是否破坏缓存:不涉及——改动作用在 dispatch 层(发给哪个 origin / 是否拒绝),不碰消息内容、前缀缓存、fold 状态;refusal 是本地 422,客户端不落任何东西。

  7. 是否改了设计方向:架构未变(只是把三道既有契约从 dsh 私货上提到共享层);唯一契约变化是 permanence invariant 退役(见第 5 问),即本 PR 目的。panel attribution 面扩展到 dsh 之外仍是待决策项,留在 [pi] Direct connection fallback after proxy disconnect: no oversized rejection, no self-healing, no visible alerting (al | [pi] 代理失联后的直连兜底无 oversized 拒绝、无自愈、无可见告警(opencode/dsh 都有)—— 1.06M token 原始历史被直接送进上游 #4516 讨论内,不单开 issue(loop guard)。

  8. 是否引入了新的配置:不涉及——无新 env/config/CLI flag;RESPAWN_COOLDOWN_MS=15s 与 spawnWaitMs 是内部常量/状态字段,非用户面。

CI 与可合并性:

  • PR mergeable: true(behind master,但与本 PR 触碰的文件零重叠,无文本或语义冲突)。
  • 修复前 head bc50f1a87:最新一波 CI 全绿(CI + 全部 e2e lane);更早同一 sha 的一波 9/10 test shard 红但 static gates 两波都绿、且相同代码后一波全绿——pattern 符合环境 flake(§7.2 类),具体失败测试名因 API 响应截断拿不到。
  • 修复后 head 5b8424d2c:11 个 workflow 排队中。
  • 本地:定向套件(新 issue 套件 + native-intercept/selfheal/dsh-native/pi-native)185/185 绿;typecheck 干净(均在 5b8424d2c 上)。

判定:无阻断项,建议新 CI 波次转绿后由 owner 合并。 唯一决策项(自愈范围是否收窄到仅 bootstrap-fail)可在合并后定,不影响可合并性。我不关闭、不合并,留待 owner。

ci-check and others added 3 commits October 25, 2026 23:02
…ment

#4316 PR3/3 (restampRefsToLedger) re-homes citation numbers once on every
full-mode cold load; goldens pinning exact ref numbers are born-red. Re-pin
the 7 storage-lane tests (engine-proofs x6 + orphan-recovery x1) modulo that
renumbering — zero production code touched.

- golden-storage-drive.ts: per-turn citation-normalized digest (shaCiteNorm)
  and state digest modulo stripOneTimeAlignment (stateDigestAligned); the
  deep-sort helper is hoisted into golden-canonical.ts for sharing.
- corrupt-index-child.ts: new stripOneTimeAlignment normalizer — strips the
  refLedgerAligned stamp and re-homes refs onto canonical raw-id order so a
  clean full-mode read and the legacy fallback load compare equal.
- storage-engine-proofs.test.ts: wire legs assert shaCiteNorm equality vs
  the legacy restart leg and the committed goldens; state legs assert
  stateDigestAligned; rollback leg now spells BILI_STORAGE_UNIFIED=legacy
  explicitly (#3818 flip: absent resolves to full, deleting the env would
  vacate the legacy path).
- storage-orphan-recovery.test.ts: pins the content-addressable
  byRaw->byRef round-trip instead of a counter-era m00003 literal.
- golden/storage-render/*.json regenerated with shaCiteNorm/stateDigestAligned.

Converges the master-red storage-lane family (#4599 plan A, owner directive).
…dger parity masks

The #4316 one-time renumbering restamped messageRefs but left
state.tokenSnapshot keyed by the OLD refs, so post-restart bodies
carried stale per-message token counts (1.3K vs 1.4K) and the
full-mode-restart wire drifted off the legacy baseline (#4599).

persist.ts: two-pass remap (stage moves, delete old keys, then write
new keys) so entries whose new ref collides with another move's old
ref survive; fires only when superseded refs exist.

Aligned normalizer (corrupt-index-child.ts): the cacheLedger's
segment bookkeeping (be/bl/bs, unfinalized tail line), the derived
agg block, and per-line miss-attribution (prov/seam) are restart
experience, not content — no-restart and restart legs legitimately
differ there. Masked in the aligned view only; raw digests keep
full accounting. Goldens regenerated (stateDigest + aligned).

storage-engine-proofs 12/12, golden-storage-render 5/5 locally.
ranxianglei and others added 10 commits October 26, 2026 01:03
…persisted state (#4599)

The fork-survival test asserted immediately after the compress tool
response, but the fold lands in the live session state asynchronously
(#3573 replay semantics). Slow CI runners persisted the pre-fold state
('0 block(s) (compressions=0)' cold load) and the deepEqual diverged.
Bounded 5s wait on the in-memory fold; fast machines exit on the first
iteration. Product semantics unchanged.
The #4316 cold-load alignment reads the unified sidecar; its ingest of
just-flushed records completes asynchronously. Slow runners compared
the pre-ingest state and saw refLedgerAligned missing while the fold
itself had landed. Poll (bounded 5s) until the loaded state carries
the flag; fast machines exit on the first probe.
Git-for-Windows autocrlf checks the bundled .md posts out with CRLF;
the exact-match '---' fences then failed to parse and every post lost
its title/excerpt/date frontmatter (Windows CI: 'bundled meet-bili post
found' assertion). Normalize CRLF to LF inside parseFrontmatter when
the fence is CRLF-shaped; LF content is byte-identical as before.
Regression test with a CRLF fixture.
… storage mode (#4599)

The #4316 cold-load alignment sets refLedgerAligned only when the
unified store is available; config-clean machines (CI runners) run
legacy mode where it is an honest skip. The test asserted the flag
unconditionally, so every shard carrying this file was born-red on CI
while unified-config machines passed. Expectation now mirrors
store.replicasAvailable(); verified 49/49 in BOTH modes locally.
The ci-check lane's expectation change (c496cfb) exposed a real Windows
bug: stripInheritedProxy builds inlineEnv as a spread copy of process.env,
which keeps the original key casing (ComSpec) — Windows env vars are
case-insensitive but plain objects are not. planClientSpawn's exact
env.COMSPEC probe then missed it and silently degraded every wrapped spawn
to the bare-name 'cmd.exe' fallback (verified by repro on a real win32 box:
childEnv.COMSPEC=undefined while process.env.COMSPEC was set).

Fix: probe COMSPEC/ComSpec/comspec in planClientSpawn and planDshSpawn.
Verified on real Windows (Node 22): launcher-opencode-inline + fix-679 +
dsh-refresh 37/37; host tsc clean, 35 pass / 2 win32-skips.
…OMSPEC case-probe

c496cfb re-derived the win32 expectation from ambient process.env, which
still mismatches production: Node's process.env member access is
case-insensitive on Windows while the child env handed to the planner is a
plain object whose key keeps the OS casing (ComSpec), so the exact
env.COMSPEC probe fell through to the bare-name fallback. The assertion now
derives from the child's OWN captured env/options and probes
COMSPEC/ComSpec/comspec exactly like planClientSpawn does post-dfeea8a11 —
self-contained under any concurrent-test env churn in single-process CI
shards — and additionally pins windowsVerbatimArguments=true on the wrap.
… headerless fast path, respawn rejection hardening (#4546)
@ranxianglei
ranxianglei merged commit c0e60cb into master Oct 26, 2026
22 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.845-master.c0e60cb (rolling master tag).

npm install -g billion-context@0.0.845-master.c0e60cb  # 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.

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

Labels

bug Something isn't working p2 pi scope/wiring

Projects

None yet

1 participant