Repository navigation
[PR] fix(responses-ws): bound the prewarm probe and make busy-lane rejections reconstructible (#6172) - #6292
ranxianglei wants to merge 2 commits into
Conversation
…ons reconstructible (#6172) The prewarm probe was the one unbounded upstream call in a Responses WS session: no signal, no watchdog. A wedged handshake or a silent first event pinned busy=true forever and 409'd every later turn until the client disconnected — the residual-state path behind the 29 response-in-progress rejections in #6172. The turn path was already bounded (client-disconnect abort + two-phase idle watchdog); the probe is now held to the same discipline with the existing budgets (first-byte covers handshake + first event, idle covers mid-stream silence). An abort lands as the explicit 'Probe relay failed' frame and the lane releases either way. - Centralize admission release in settle(kind, outcome): per-admission generation counter, activeMeta (kind/prev_id/items/bytes/age), and an 8-entry transition ring so every release is exactly its own admission's. - Enriched rejection line keeps the exact prefix 'client rejected reason=response-in-progress' and adds req_bytes / req_prev_id / req_items plus active_gen / active_kind / active_age_ms / active_prev_id / active_items / active_terminal / admitted / transitions. Identifiers only; message bodies never reach the log. - Tests: the overlap-rejection line pins the enriched fields; a new black-hole-upstream test proves a wedged probe fails within budget and releases the lane (a second probe on the same connection is admitted).
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9186-pr.6292.90e6364This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6292.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) Picked up this [PR] thread to verify the existing agent PR (body carries the 查重: 不重复。Only one open PR targets #6172 — this one (#6292, branch 标签: intended set = In progress now: full diff review of the single commit, live CI status read, and a targeted local run of |
(ai: vllm-qwen/qwen3.8-27b) Verification complete. I reviewed the full single-commit diff ( What I verified
Regression inventory (existing behaviors on the touched paths): rejection wire frame byte-identical ( Two non-blocking observations
判定: 可合并 — CI 全绿、定向测试全过、无回归、行为变更已在 PR 内披露。等 owner 合并即可(合并权在 human)。 结构化八问
收尾判定:可合并,等 owner 点合(PR #6292,head |
(ai: vllm-qwen/qwen3.8-27b) The full verdict is already in this thread (my comment above, comment id 73214) — this nudge appears to have raced the post. Restating the bottom line only: Outcome: PR #6292 verified, no code changes made (agent-PR marker → verify-only mode).
判定:可合并,等 owner 点合 PR #6292。Nothing remains open from this session. |
Closes #6172
What this fixes
The prewarm probe (
input: []+generate: false, sent by Codex on every fresh connection) was the one unbounded upstream call in a Responses WS session: no abort signal, no watchdog. A wedged handshake or a silent first event pinnedbusy=trueforever while the connection stayed open, so every later turn got409 response-in-progressuntil the client disconnected. That is the residual-state path the issue's 29 rejections cannot rule out — and the old one-lineclient rejected reason=response-in-progresslog made it impossible to tell that case apart from legitimate concurrency protection.The main turn path was already bounded (client-disconnect abort + two-phase idle watchdog); this PR holds the probe to the same discipline.
Changes (
src/responses-ws.tsonly)withFetchTransport(fetchWithTimeout(...))exactly like the turn path. The first-byte budget covers handshake + first event; the idle budget covers mid-stream silence. An abort surfaces as the existing explicitProbe relay failederror frame, and the lane releases either way. No new knobs — it reusesnetwork.upstreamFirstByteMs/network.upstreamTimeoutMs.settle(kind, outcome): a per-session generation counter,activeMeta(kind / prev_id / items / bytes / age) and an 8-entry transition ring replace the two duplicatedfinallyblocks. The stale-callback fear from the issue is structurally impossible here (one session per connection; each closure's settle belongs to its own admission), but it is now auditable in one place.client rejected reason=response-in-progressand appends:req_bytes/req_prev_id/req_items(best-effort identifiers of the REJECTED frame — parse failure just omits them) plusactive_gen/active_kind/active_age_ms/active_prev_id/active_items/active_terminal(turns only) /admitted/transitions=[…]. Identifiers only — message bodies never reach the log.exchange settled kind=… gen=… outcome=… duration_ms=…) and enrichedclient closedphase line when a close lands mid-exchange.Tests (
tests/responses-websocket.test.ts):Behavior changes (old → new)
Probe relay failedframe; lane releasedclient rejected reason=response-in-progress(bare)exchange settled …+ transition ringWire protocol otherwise unchanged. No config schema change.
Config surface
None added. The probe reuses the existing
network.upstreamFirstByteMs/network.upstreamTimeoutMsbudgets (BILI_UPSTREAM_FIRST_BYTE_MS/BILI_UPSTREAM_TIMEOUT_MS) — no new env vars, keys, or defaults.