Repository navigation
feat: Responses WS lane observability under /__bili/stats (part of #1926) - #1936
ranxianglei wants to merge 5 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1935-pr.1936.a15b4fbThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1936.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 收到。这是带 |
[bot] 🏷 独立复审完成(不采信实现方自述,全部重新验证)。结论:审查通过,达到可合并标准;合并顺序被 #1859 阻塞——#1859 合入 master(且必须含其集成分支内容,见下「关键依赖」)后,本 PR rebase 到 master 收敛为单提交小 PR 即可合并。 结构化七问
验证证据(本地 + CI 双重)
Rebase 风险评估(#1859 合入后)master 已从 关键依赖(需 owner 知悉,#1859 线程已催办,此处重申)#1859 当前 PR head( 小问题(不阻塞,记录在案,理由如下)
两条都不在本轮直接修:本 PR 是叠在外部贡献者未合并 PR 之上的栈式工作,分支注定在 #1859 落地后 rebase 收敛,此刻推 cosmetic commit 只会触发一轮全矩阵 CI 并增加 rebase 摩擦;留给收敛 pass 一并处理(已在上面留痕,不会丢)。 判定审查通过:方向正确(严格实现 #1926 步骤 c,零契约风险)、回归审计干净、测试有牙、CI 全绿、diff 整洁(5 文件全部与目的相关,docs en/zh 同步)。合并路径唯一阻塞项是 #1859 的落地顺序与上述 aux 修复依赖——#1859 带完整集成分支内容合入后,把本 PR rebase 到 master(单提交、预期干净)即可走合并流程。 |
|
Closing as superseded. The owner landed option (c) of #1926 independently as commit See the discussion in #1926 for the follow-up needed to land |
Part of #1926 — implements step (c): lane observability for the Responses WebSocket proxy added by #1859.
Stacked on #1859 (read first)
This branch sits directly on #1859's latest verified integration state (
323f37bb= master8ae9225a+ the three rebased #1859 commits + the buffered-auxiliary fix). Until #1859 lands on master this PR cannot merge cleanly; once it does, this becomes a single small commit rebased onto master.The real delta is the top commit only (
45aef9f, 5 files, +172/-15):installResponsesWebSocketreturns{ upgrade, stats };stats()reports peers + lane totalshandle()as an explicit parameter (matching existing per-instance threading);/__bili/statsgains aresponsesWskeyWhat it exposes
GET /__bili/stats->responsesWs:conn,session(same <=128-char prefix already logged at connect time),connectedAt,lastActivityAt,idleSeconds,active,requests,upstreamConnected,retainedBytes(client-leg + upstream-leg checkpoint bytes)peerCount,activePeers,totalRetainedBytesThis is exactly the visibility the OS-snapshot workaround in #1926 currently stands in for: which client sockets are pinned, how long idle, how much checkpoint memory is retained, and whether the upstream leg is still attached.
Design constraints honored
_liveUpstreamTimersForTest() === 0contract.doesNotMatchassertion.Behavior change disclosure
/__bili/statsgains one additive key,responsesWs. Existing consumers verified: tests read fields structurally (no whole-object equality), the web UI reads keys leniently. No other endpoint touched.Verification (on the stacked tree: master 8ae9225 + #1859 @ 323f37b)
npm run typecheck- cleannode --import tsx --test tests/responses-websocket.test.ts- 37/37 (35 pre-existing + 2 new)node --import tsx --test tests/blind-tunnel-stats.test.ts- 1/1 (stats-consumer regression)npm run build- successFull regression is left to CI on the rebased head after #1859 merges.
Steps (a)/(b) of #1926 (idle-close / checkpoint eviction) remain deferred per the issue's own gating: they need E2E-verified OpenCode host recovery after
previous_response_not_found(harness lives in #1859, unmerged) plus an owner decision on any idle threshold (config surface).