Repository navigation
[PR] fix(backend): Backend stability minor fixes bundle, Part 1 — Four reviewed minor fixes merged for review | fix(backend): 后端稳定小修合集第一辑 —— 四件已评审小修合并送审 - #5847
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.8448-pr.5847.5fcef82This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5847.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复——开放 [PR] 行中无其他指向同一后端合集主题的 PR(镜像号 5847 是另一个「Web 面板小修合集」PR,仅编号巧合,主题不同)。 已拉取分支核对:4 个提交与清单一一对应, 开始按 PR Review 规范审(方向→回归→代码→测试有效性→diff 整洁),结论按八问体例回复。 |
…claration (#3606 side-lane part) isTransientUpstreamError (src/fetch-util.ts) gains two OR'd true-paths for 4xx bodies: canonical wording markers (please retry / 请重试; bare 'retry' deliberately NOT added — 'do not retry' false-positive pinned by negative test) and bodyDeclaresRetryable(): bounded JSON scan (64 KiB cap, 4096-node budget) for actions:[...RETRY] or retryable:true, unwrapping string fields that parse as JSON (the code-11101 envelope behind #3606). Behavior change: side lanes (acp-loop replay, compress-loop-responses, preflight summarization) now retry ≤ network.replayRetryMax on such bodies instead of fail-fast. Main forwarding path untouched by design (#1688); sub-defect A of #3606 (main-path HTTP-level retry) still awaits owner decision — this PR must NOT close #3606. Picked up from PR #3610. Lock-file version drift from its base no longer present against current master.
… on restart In containers processes virtually always run as PID 1; after a restart the old writer marker (pid: 1) still passes isPidAlive() against the new process, so findContestedWriters false-positives [split-brain] on every boot. Fix: record startedAt (epoch ms) on WriterIdentity/WriterMarkerFile; a marker sharing our PID whose startedAt (or mtime for older builds without startedAt) predates this process boot by more than SAME_PID_GENERATION_MARGIN_MS is skipped as a prior generation. Integrated onto master's contestedServedAt helper (#4626); both mechanisms keep working. Original commit c115e35 of PR #5028 (external contribution by @fathonix; later review-fix commits of the same PR condensed into this one — full credit retained via git author).
…tier so keepalive actually arms (#5665) detectKeepaliveTier only armed when a breakpoint carried an explicit ttl of 1h/5m; the default form cache_control:{type:ephemeral} (no ttl) returned undefined and armInternal exited silently — contradicting CONFIGURATION.md (which said: 1h when any breakpoint declares ttl:1h, else 5m). Now any breakpoint without explicit ttl is 5m-tier; explicit ttl:1h still lifts to 1h; intervalMs still wins. Picked up from PR #5669 (issue #5665).
…e-lane hosts can exit (#5672) The recurring keepalive setTimeout had no .unref(), so on an inline lane (proxy inside host process) a short-lived host (pi -p / sub-agent print-json run) kept living until maxDurationMs (default 24h), pinging upstream the whole time — the armed timer was typically the only live handle left after the turn ended. Default scheduler and test-reset now route through one realSchedule() helper calling t.unref?.() at every arm/reschedule site (initial arm, busy-reschedule, post-ping reschedule), matching the existing repo idiom (~49 other unref call sites). Picked up from PR #5672.
… rung order (30a8bc2) Upstream 30a8bc2 (merged via #5734 on Nov 6) made an authored-checkpoint conv declaration re-anchor on the raw lane BEFORE the store-overlap rung, and even when the store view is null — its own commit message documents 'this shape went from forks to re-anchors'. It added tests/issue5719-self-checkpoint-reanchor.test.ts but did not realign T1/T8 of this older suite, leaving every old-base PR (and the main branch itself) red on exactly those two pins. T1 now pins the self-declaration reason string (same outcome asserts kept: key raw + action reanchor); T8 now expects reanchor on the raw key where it previously expected the byte-evidence degrade to derived-persona/sub-fork. Marker-less shapes untouched (their pins still pass unmodified).
f0ed83f to
151efca
Compare
(ai: vllm-qwen/qwen3.8-27b) PR #5847 独立审核完成:可合(待 CI 绿)。 四件小修逐件过代码、本地定向测试全绿、交叉引用全部对过号。审核中发现两处问题:一处已直接修掉(错引 issue 号,已推提交),一处需要你留意(分支中途 rebase 带进来一个 master 存量红修复)。详见下文发现清单。 结构化八问
审核发现与处置
验证证据
|
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1064-master.9696c08 # this exact build
npm install -g billion-context@master # always the newest merged build
|
这个 PR 干什么
把四个此前各自挂审未合的后端小修收进一个分支,一次 CI、一次送审。每件原本都是状态板(#3916)上 ✅可合 的独立 PR,各自分支 CI 红绿参差,合一后以本 PR 的新 CI 为准。
清单(一件一个独立提交,+283/−9,8 文件)
fix(retry): transient-4xx classifier honors upstream machine retry declarationactions:["RETRY"]、retryable:true,含 JSON-in-string 信封;新增please retry/「请重试」措辞,裸词 retry 不加以免 "do not retry" 误伤——有负例钉住)现在被侧车道(acp-loop 重放、compress-loop-responses、preflight 摘要)识别为瞬态并重放,不再一次就死。主转发路径按设计不动fix(served-markers): ignore prior container generations with same PID on restartkill(1,0)恒活,每次开机误报[split-brain]。现在标记带 startedAt,同-PID 但早于本进程开机的判为上一代直接跳过;旧版标记无 startedAt 时用文件 mtime 兜底fix(cache-keepalive): treat ttl-less cache_control breakpoints as 5m tiercache_control:{type:"ephemeral"}(不写 ttl)以前永远臂不上保活(静默 no-op),与 CONFIGURATION.md 文档行为矛盾。现在无 ttl 断点按 5m 档臂活,显式 ttl:1h 仍升 1h 档fix(cache-keepalive): unref the keepalive timers so short-lived inline-lane hosts can exit.unref():内联车道的短命宿主(pi -p、子代理 print/json 跑完)唯一的活句柄就是它,进程要空转到 maxDurationMs(默认 24h)才退,期间一直 ping 上游。三个臂活/重排点统一走 realSchedule() 加 unref贡献身份保留
#5028 是外部贡献:@fathonix 的原提交(c115e35)+其后续评审修订收进单个提交,git 作者字段保留为 Aldo Adirajasa Fathoni aldo.alfathoni@gmail.com,squash-merge 后署名仍留在合并历史里。
冲突消解说明(#5028 两处)
src/served-markers.ts:master 在其上次同步后把判定重构进了共享助手contestedServedAt()([Bug][split-brain] Restart-handover notice persists forever after the peer pid is gone (stale storage.splitBrain) #4626)。消解 = 两边意图并集——[PR] fix(served-markers): ignore prior container generations with same PID on restart (#3923) #5028 的同-PID 代际跳过放在助手调用之前(它是文件级身份判断,独立于 servedAt 取值),[Bug][split-brain] Restart-handover notice persists forever after the peer pid is gone (stale storage.splitBrain) #4626 的 graceful-stop 双时间戳跳过逻辑原样保留;注释取两侧描述之和。src/server.tsimport 块:取并集(master 新增的 findPresentUnverifiedSameLaneTwin/resolveOwnFingerprint/SPAWN_FINGERPRINT_ENV/registerSplitBrainEvidenceCheck 等保留,[PR] fix(served-markers): ignore prior container generations with same PID on restart (#3923) #5028 需要的 processStartMs 加入;PR 旧基线遗留的 entryScriptFingerprint 引用在合并后已不存在,一并去掉)。第一件只交付了 #3606 的侧车道子缺陷;主转发链路的 HTTP 级重试(子缺陷 A)仍在 issue 线程里等 owner 在三案之间拍板。所以本 PR 不含
Closes #3606,请在合并时留意不要手滑勾掉它。另:#3923 已于 10-20 被 #3952(split-brain 可见性方向)关闭,本件是其未覆盖的假阳性修复方向,不重复关单。
Pre-flight 结果
本 PR 合并后处理的 issue
Closes #5665
CI 修正补记(2026-11-07,首次送审后新增一个提交)
首版在三个 shard 上红于同两个测试(
#5719 T1/T8),与本 PR 改动无关:上游30a8bc2d(经 #5734 于 11-06 合入)改了src/session-resolve.ts的 re-anchor 档序却漏同步了旧套件里两根钉子,导致所有基于 11-06 前 master 的 PR(包括主干自身)同时在这两点变红——纯 master worktree 本地复现同样两失败、无关分支的 CI 亦同红,均核实。本分支已 rebase 到新 masterc45ac219,并按 #5734 自己 commit message 文档化的行为变更重对齐这两根钉子(T1 改钉新档 reason 串,key/action 断言不变;T8 由期望derived-persona改为reanchor)。对本 PR 原有各件零影响。