Skip to content

[PR] fix: release request input buffers before long-running responses - #4766

Open
ranxianglei wants to merge 14 commits into
masterfrom
2026-10-26_input-buffer-lifetime
Open

ranxianglei wants to merge 14 commits into
masterfrom
2026-10-26_input-buffer-lifetime

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #4753

What

Three input-lifetime retention sites kept request-side memory alive across the entire response of large requests:

  1. readBody (src/server.ts) never removed its data/end/error listeners, so a closure holding every network chunk stayed attached to the request for its whole life; a close before end left the promise pending forever (admission-slot leak). Now every settlement path (success / error / abort / oversize) detaches its own listeners and drops the chunk array, and close-before-end rejects with an explicit abort error.

  2. rememberPluginMessages (src/plugin.ts) received the raw inbound Buffer after forwarding and re-parsed + re-walked it for the text-comparability verdict. The raw-wire hash and verdict are now computed before prepare mutates the parsed graph (anchored on the original parse, gated on the plugin lane), and only those two scalars cross to the existing post-forward bookkeeping point. Hash-gate semantics unchanged.

  3. handleRequest's frame (src/server/handle.ts) retained the raw body, decoded text, parsed graph and the overflow-refold preparation closure across the entire response stream. forward() now takes an onRetriesSettled callback fired exactly once when every upstream attempt has finished (initial send, role ladder, pck probe, image-count retry, overflow refold), before the first response byte; handleRequest releases its input cells there.

Per the issue scope: accepted outbound bodies (fake-completion/blind retries, echo provenance) and the session pin stay through the response. No admission controls, no storage changes, no kernel changes, no config surface added.

Behavior change (disclosure)

  • Request-body close-before-end: previously left a permanently pending readBody promise and leaked the admission slot until process exit; now rejects with "request aborted before body completed". The admission slot is released either way.
  • No other wire/config/persistence change. publicSnapshotWireHash / publicSnapshotTextComparable values are byte-identical to before (pinned by a parity corpus against the old algorithm plus e2e pipeline tests asserting the exact inbound hash).

Validation

  • New tests/issue4753-input-lifetime.test.ts: precomputed-vs-old-algorithm parity corpus (13 wire shapes incl. garbage/null/array/unicode), scalar-gate unit tests, e2e pipeline parity through the real proxy (exact sha256 of the sent bytes + both verdict directions), settlement-ordering probes (fires exactly once, before the first streamed byte on 200 and before the error write on 400, never on fast paths), same-session concurrency smoke. Plus four listener-removal regressions in tests/proxy-readbody.test.ts covering all settlement paths (the five-byte repro from the issue).
  • Regression gates run locally green: refold family (issue1195-overflow-refold, e2e-overflow-selfheal, issue3787-overflow-refold, fix-arm-headroom-clamp, refold-wiring), plugin-fork, session-transient-memory, context-overflow; typecheck + build clean. Full-suite verdict is the remote CI test lanes on this head.
  • Branch carries a merge of origin/ci-fixes (sentinel lane, CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599) to ride out inherited master reds.

ci-check added 2 commits October 26, 2026 02:18
Three retention sites kept input-only data alive across the whole
response stream of large requests:

1. readBody never removed its data/end/error listeners, so the closure
   holding every network chunk stayed attached to the request for its
   whole life; a close before end left the promise dangling forever
   (admission leak). All four settlement paths now detach their own
   listeners and drop the chunk array; close-before-end rejects with an
   explicit abort error instead of hanging.

2. rememberPluginMessages took the raw inbound Buffer AFTER forwarding
   and re-parsed + re-walked it. The raw-wire hash and text-comparability
   verdict are now computed BEFORE prepare mutates the parsed graph
   (anchored on the original parse, gated on the plugin lane) and only
   those two scalars cross to the existing post-forward bookkeeping
   point; hash-gate semantics are unchanged.

3. handleRequest's frame retained the raw body, decoded text, parsed
   graph and the overflow-refold preparation closure across the entire
   response stream. forward() now takes an onRetriesSettled callback,
   fired exactly once when every upstream attempt has finished (initial
   send, role ladder, pck probe, image-count retry, overflow refold),
   before the first response byte; handleRequest releases its input
   cells there. Accepted outbound bodies (fake-completion/blind retries,
   echo provenance) and the session pin stay through the response by
   design.

Behavior change: a client disconnect mid-body now surfaces as a
rejected readBody ("request aborted before body completed") instead of
a permanently pending promise; the admission slot is released either
way. Previously the slot leaked until process exit.

Closes #4753
@ranxianglei ranxianglei changed the title fix: release request input buffers before long-running responses [PR] fix: release request input buffers before long-running responses Oct 25, 2026
…nput (#4753)

Review finding on this PR: affinityMessagesCache (chain-fingerprint /
resume-detection memo) aliases parsed.messages or input/contents, so the
inbound message array stayed pinned on the suspended handleRequest frame
across the whole response stream even after parsed was released. Null it in
releaseRequestInput alongside the other input cells.

Verified: typecheck clean, tests/issue4753-input-lifetime.test.ts +
tests/proxy-readbody.test.ts 30/30 green.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 重复 #4756(同症状 + 同机制 + 同根因,先来后到 #4756 优先)。

标签: pr(原有)、duplicate(与 #4756 同机制并行)、bug(内存驻留缺陷)、scope/wiring(请求管道输入生命周期)、p2(功能可用,大请求长响应下慢性内存增长,有 OOM 风险但不破坏功能)。

独立审核(未复用 #4753/#4756 任何一侧的既有结论,diff 两边都重读了)

本 PR 实现正确,逐项核实过:

  1. readBody:成功/错误/abort/oversize 四条结算路径全部 detach 四个监听器并清空 chunk 数组;oversize 先 settle 再 destroy 再 reject,无双结算;close-before-end 从「promise 永久挂起 + admission slot 泄漏」变为 reject request aborted before body completed。所有调用方(handle.ts divert 路径、主管道 catch、admin 面板、incremental-lane、plugin-render)逐个查过,无新增悬挂或吞错。这是唯一语义变更,披露合理(旧值=永久 pending 泄漏 → 新值=显式 reject,slot 两条路都释放)。
  2. hash/verdict 前移:锚定原始 parse 结果、只有两个标量跨界;session.pluginSnapshot 的所有写入点本来就都在 pluginAgent === "string" 门内(fork 子拷贝、存储恢复路径同门),唯一行为消费方 forkSnapshot() 对非 plugin 会话先走 raw snapshot unavailable guard——「只在 plugin 车道计算」相对旧「全模式写元数据」不构成回归,旧写入是无行为消费者的死数据。
  3. onRetriesSettled:fire 点确认在所有上游尝试(initial send / role ladder / pck probe / image-count retry / overflow refold)结束之后、消费上游响应(首字节)之前;attempt 与 settlement 之间无 early return;fast path(codexForge/autoModeForge/本地拒绝)不 fire,但那些路径本就快速终结;恰好一次。settlement 之后 handleRequest 无任何输入侧读者(INCOMING dump 与 publicForkInputCheck 均在 forward 前同步执行)。
  4. 测试是真测试:parity corpus 用旧算法逐字做 oracle(12 种 wire 形状含 garbage/null/array/unicode/thinking block);e2e 走真实 proxy 断言入站字节精确 sha256 + verdict 双向;ordering probe monkeypatch res.write/end 断言 settled 先于首字节;4 条监听器回归逐路径断言 listenerCount===0。非恒真断言,bug 回归时抓得住。

本地(head 1544b5a):typecheck/build clean;issue4753-input-lifetime + proxy-readbody 30/30;refold 族 + plugin-fork + session-transient-memory + context-overflow 共 120/120;e2e-overflow-selfheal 3/3、fix-arm-headroom-clamp 3/3。

审核中发现一个真实缺口(已修,已推):affinityMessagesCache(src/server/handle.ts:1248,chain 指纹/resume 检测 memo,别名 parsed.messages/input/contents)在每条 identified-client 请求上被填充(chainFingerprint @1466),但 releaseRequestInput 没有置空它——挂起帧在整个响应流期间继续持有入站消息数组,而大长会话请求里 messages 是 body 的大头,最大的一块没放掉。无正确性影响(settlement 后无人读),但 #4753 的内存目标没完全达成。#4756 放了这一处。已在本分支直接修复(releaseRequestInput 增加 affinityMessagesCache = null;,独立 commit,标注 #4753),typecheck clean + 30/30 绿,新 head 139c9db。注:该 head 之前的 CI runs 全部被我这次 push 顶替取消,新 run 在途;分支已含 ci-fixes 1fa9373(当前 tip,#4599 floor 205),预期继承红不复发,权威判定仍以远端 CI 为准。

与 #4756 的对比(同机制家族):

八问

  1. 是什么问题:大请求在处理期间把请求侧内存(body chunk、解析图、消息数组)一直留到整个响应流结束,大请求负载下堆持续增长(fix: release request input buffers before long-running responses #4753 观察到 4 GiB OOM;报告本身说明该 OOM 的确切分配点未钉死,但这类保留是确定的不必要持有)。
  2. 什么原因导致的:三个独立保留机制——① readBody 监听器永久挂载不 detach(close-before-end 时 promise 永久挂起连带 slot 泄漏);② rememberPluginMessages 转发后拿原始 Buffer 重解析重遍历(冗余工作且延长 Buffer 寿命);③ handleRequest 是挂起的 async 帧,V8 保留挂起帧的全部局部变量,输入侧 locals(含 memo 缓存)把分配钉在整个响应流上。
  3. 影响范围与严重程度:任何模式 × 大请求(长会话压缩回放 body 可达 MB 级)× 长响应(流式生成),响应越长驻留越久;严重度 p2——功能无损、可绕行(重启进程),但车队规模大请求负载下是慢性内存增长/OOM 风险。
  4. 怎么修复的:「重试结算即释放输入单元」——readBody 每条结算路径 detach 监听器并清空 chunk;hash/verdict 前移到 prepare 变更之前只带两个标量;forward() 增加 onRetriesSettled 回调,在所有上游尝试结束、首字节之前恰好 fire 一次,handleRequest 在那里置空 bodyBuffer/bodyText/parsed/overflowRefold/(affinityMessagesCache,本次审核补修)。出站 body 与 session pin 按设计保留(fake-completion/blind retry 与 echo provenance 结算后还要读)。
  5. 是否有回归问题:审过的既有行为——(a) close-before-end:旧=永久 pending+slot 泄漏 → 新=显式 reject,调用方全部安全处理,唯一语义变更且已披露;(b) publicSnapshotWireHash/TextComparable 值字节不变(parity corpus + e2e 精确 sha256 钉住),写入面收窄到 plugin 车道经核实无行为损失;(c) refold/role ladder/pck/image-count 重试语义不变(fire 点在尝试结束后、响应消费前,恰好一次,fast path 不受影响);(d) admission slot 生命周期不变。未发现其他语义漂移。
  6. 是否破坏缓存:不涉及——出站字节不变(hash-gate 语义保持,parity corpus 钉住),前缀缓存接缝不受影响;释放的纯是请求侧内部内存。
  7. 是否改了设计方向:不涉及——架构/边界/数据流无转向,现有管道内收紧输入生命周期;未加配置面。
  8. 是否引入新配置:不涉及——无新 env/config/默认值。

收工判定

代码质量通过(缺口已补)。建议合 #4756(先来后到 + 覆盖更完整),前置条件:把它 merge 一次 origin/ci-fixes 清掉 5 片继承红(哨兵批量或作者自行均可);本 PR 已打 duplicate,等 owner 决定关闭。若 owner 偏好本 PR 更干净的 API,缺口已在分支上修复(head 139c9db),可直接用。两个 PR 我都不会执行关闭。

@ranxianglei ranxianglei added bug Something isn't working duplicate This issue or pull request already exists p2 scope/wiring labels Oct 25, 2026
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-26_input-buffer-lifetime (ef134e3)

Latest build — install this exact version

npm install -g billion-context@0.0.10511-pr.4766.73ca92c

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
ef134e3 billion-context@0.0.10511-pr.4766.73ca92c build
2f76ccf billion-context@0.0.10509-pr.4766.d1bc6a6 build
e022f2c billion-context@0.0.9342-pr.4766.df0c52e build
68fa75b billion-context@0.0.9332-pr.4766.13b7055 build
0a6d13d billion-context@0.0.6147-pr.4766.772f0f0 build
e841867 billion-context@0.0.6062-pr.4766.80481a3 build
b085be6 billion-context@0.0.5949-pr.4766.1417b43 build
139c9db billion-context@0.0.5848-pr.4766.5739bae build

Download artifact

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

Install instructions are refreshed on each push.

ci-check added 5 commits October 26, 2026 10:15
Resolve conflicts from 1340 commits of master drift:
- src/server/handle.ts: union import (computeRawWireBookkeeping +
  pluginCompressionProxyHeader); the forward() call keeps the
  releaseRequestInput closure + #4753 comment and appends it to
  master's new onWireBody arg list.
- src/server/relay.ts: forwardCaptured() signature — master's
  throttleModelHint + onWireBody, then onRetriesSettled (last).
- tests/issue4753-input-lifetime.test.ts: the settlement-hook probe
  forward() calls gain two positional undefineds (throttleModelHint,
  onWireBody) before onRetriesSettled; the frozen comparableHistory
  oracle is updated to track master's #4266 thinking-family handling
  (thinking block fixture now expects textComparable=true — the canonical
  walker treats string-payload thinking as comparable by view).
The #4753 bookkeeping type is only consumed inside src/plugin.ts (return
type of computeRawWireBookkeeping, param of rememberPluginMessages); no
other module imports the type name. Drop the leading export so the
unused-exports gate passes.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Resolved the merge conflict and the red CI check on this PR in one pass. Live state verified against the GitHub API on head e022f2cfc6:

  • Merge conflict: resolved. The branch was dirty (1340 commits behind master). I merged origin/master into the branch and resolved the 3 conflict hunks. The PR is now mergeable: true.
  • Red CI check: fixed. The unused-exports gate was failing on RawWireBookkeeping (exported in src/plugin.ts but never imported by any other module). Dropped the export — it's module-private.
  • Full suite: green. 40 success / 16 skipped / 0 failed / 0 pending on head e022f2cfc6.

Two commits pushed to 2026-10-26_input-buffer-lifetime:

  1. 68fa75b1fd — Merge master: conflict resolution + test fixes for master's new forward() arg list and the Zero-Inheritance Session Cloning: Unified Fix for Eight Independent Defects in the Fork Adoption Chain (Next Release Tar | 会话克隆零继承:fork 收养链上八类独立缺陷统一修复(下版目标) #4266 thinking-family oracle.
  2. e022f2cfc6 — Make RawWireBookkeeping module-private (unused-exports gate).

Note: the PR is currently mergeable_state: behind — master advanced after my merge. That's a transient, non-blocking state (the PR is still mergeable); I did not chase the moving master tip. Say the word if you want it fully re-merged before merge. (Context: #4756 remains the confirmed duplicate pending your pick — out of scope for this CI-fix lane, left untouched.)

八问

  1. 是什么问题:PR [PR] fix: release request input buffers before long-running responses #4766(fix: release request input buffers before long-running responses #4753 输入缓冲释放)与 master 产生合并冲突(dirty,落后 1340 个提交),且 CI 的 unused-exports 门禁红。本任务要求一次性解决冲突 + 红 CI。
  2. 什么原因导致的:① 冲突——master 的 Zero-Inheritance Session Cloning: Unified Fix for Eight Independent Defects in the Fork Adoption Chain (Next Release Tar | 会话克隆零继承:fork 收养链上八类独立缺陷统一修复(下版目标) #4266 等变更改了 forward()/forwardCaptured() 签名(新增 throttleModelHint+onWireBody)和 plugin 导入,而本 PR 新增 releaseRequestInput/onRetriesSettled,两边改了同一批调用点;② unused-exports——PR 新增的 RawWireBookkeeping 类型被 export 但没有任何其他模块 import(只在 plugin.ts 内部用作返回类型/参数类型)。
  3. 影响范围与严重程度:冲突使 PR 无法合并(dirty),阻塞 fix: release request input buffers before long-running responses #4753 修复合入;unused-exports 是 CI 门禁失败(非运行时 bug),阻塞 CI 转绿。类型去 export 本身对运行时零影响。
  4. 怎么修复的:① 冲突——把 origin/master 合入分支,解 3 处冲突(handle.ts 导入取并集、handle.ts 的 forward() 调用保留 releaseRequestInput 闭包并追加到 master 新参数列表末尾、relay.ts 的 forwardCaptured() 签名按 master 新参数 + onRetriesSettled 收尾);② 测试——结算钩子探针的 3 处 forward() 调用补两个位置参数 undefined(对应 master 新增的 throttleModelHint/onWireBody),冻结的 comparableHistory oracle 更新为跟踪 master Zero-Inheritance Session Cloning: Unified Fix for Eight Independent Defects in the Fork Adoption Chain (Next Release Tar | 会话克隆零继承:fork 收养链上八类独立缺陷统一修复(下版目标) #4266 的 thinking 家族处理(thinking block fixture 期望改为 textComparable=true);③ unused-exports——去掉 RawWireBookkeeping 的 export(模块私有,无其他模块引用该类型名)。
  5. 是否有回归问题:无。typecheck 通过;改动的两个测试文件 30/30 通过;unused-exports 门禁干净;全量 CI 绿(40 success / 16 skipped / 0 failed)。fix: release request input buffers before long-running responses #4753 的 parity 不变量(precomputed == old)仍成立——computeRawWireBookkeeping 与旧的 re-parse 路径调用同一个模块级 comparableHistory。冲突解决保留了两边意图(导入并集、forward 双参数),无语义漂移。
  6. 是否破坏缓存:不涉及——未触碰任何缓存/重试/游标/去重键逻辑。
  7. 是否改了设计方向:不涉及——无架构/边界/数据流转向;本次是合并冲突解决 + 一个机械的类型去 export。
  8. 是否引入了新的配置:不涉及——无新 env/config/默认值。

判定:冲突已解、CI 全绿,PR 可合(mergeable: true)。当前 behind(master 在我合并后又前进了)是瞬态非阻塞项,未追移动中的 master tip;如需合并前完全对齐,我再合一次 master。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Finding: this PR is now redundant — the #4753 fix is already in master.

While resolving the new merge conflict (master advanced 570 commits since my last merge), I found that master has already merged the #4753 fix — via a cherry-pick of the earlier duplicate PR #4756 (z0d0dOr's fork) plus two follow-up fixes:

Why our PR is redundant (and inferior):

  • Same 4 source files (plugin.ts, server.ts, handle.ts, relay.ts), same goal (release input buffers before streaming).
  • Master's API differs: preparePluginWireMetadata / PluginWireMetadata (master) vs computeRawWireBookkeeping / RawWireBookkeeping (ours). Our test file (tests/issue4753-input-lifetime.test.ts) imports our API, which no longer exists in master — it would fail CI.
  • Master's fix is strictly better: it releases runPreparedPipeline (which our overflowRefold closure depends on) and handles bodyText conditionally (the 3728f968fd fix, handle.ts:756). Our PR unconditionally set bodyText = undefined, which broke the watermark fastpath — a regression master already fixed.

What I did this run:

  • Merged origin/master (e0d63bf) into the branch → 4-file conflict (plugin.ts, server.ts, handle.ts, relay.ts).
  • Investigated the conflict → discovered master already has the fix: release request input buffers before long-running responses #4753 fix (above).
  • Aborted the merge (branch left clean at e022f2cfc6). I did not force a merge: it would either (a) revert master's two follow-up fixes (a real regression) or (b) produce a no-op PR (adopt master's version everywhere + delete our now-stale test file).

Recommendation: close #4766 as redundant (the fix is already in master via #4756 + follow-ups). I can't close PRs (owner-only). #4756 is likewise now redundant (it was the source of the cherry-pick).

八问:

  1. 是什么问题: 这个 PR 现在冗余了——master 已经合入了 fix: release request input buffers before long-running responses #4753 的修复(通过 cherry-pick 更早的重复 PR [PR] fix: release input-only request data before streaming #4756 + 两个后续修复),我们的 PR 没有新增任何内容。
  2. 什么原因导致的: 更早的重复 PR [PR] fix: release input-only request data before streaming #4756(z0d0dOr 的 fork)在我们这个 PR 清理冲突之前,被 cherry-pick 进了 master(6c0079b5f0),并带了两个后续修复(bdf1ac0d57 修 cherry-pick 时的 marker slip、3728f968fd 修 bodyText 无条件释放导致的 watermark fastpath 回归)。
  3. 影响范围与严重程度: 对用户无影响(修复已经在 master 里)。这个 PR 只是冗余;若强行合入反而会回退 master 的两个后续修复(真回归)。
  4. 怎么修复的: 无需修复——修复已经在 master。我中止了 merge(分支保持干净在 e022f2cfc6),没有强推。
  5. 是否有回归问题: 无——我没有强推(强推会回退 master 的 3728f968fd 修复,那才是真回归)。
  6. 是否破坏缓存: 无。
  7. 是否改了设计方向: 无。
  8. 是否引入了新的配置: 无。

判定: 建议 owner 关闭 #4766(冗余,修复已在 master)。本分支未做任何推送,保持原样。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

ci-check and others added 5 commits November 16, 2026 20:42
The probe anchor PROXY_TOOL_AT=6 was calibrated on 2026-10-31 for #4521
(schedule {4,6,8,9}). The nudge scheduling has shifted again — nudge now
lands at {3,5,11,14}. Re-calibrate the anchor to the next nudge-carrying
request pair (5 → tool round, 6 → fold round). The fold/proxy-tool-round
mechanics under test are unchanged.

Closes: master-red on test (windows-latest, 22, 3) and (ubuntu-latest, 22, 1).
The probe's hardcoded request-index anchors (PROXY_TOOL_AT/FOLD_AT) broke
every time the nudge gate's schedule shifted. The last recalibration
(245ecb1) was measured on a direct local run (timestamps ON by default
since #4313), but CI runs the suite preload pin BILI_MESSAGE_TIMESTAMPS="0"
(timestamps OFF) — a different wire shape, a different schedule (no nudge at
index 5) — so it passed locally and failed on every CI shard.

Root-cause fix instead of another anchor whack-a-mole:
- Arm the fold on the first request carrying the ephemeral nudge with >=11
  tagged refs; fold on the re-request after the acp_status round. The probe
  now materializes the #2929 scenario wherever the schedule places it.
- Pin compress.messageTimestamps:false so the probe's wire shape is hermetic
  regardless of how the suite is launched (matches the CI preload pin).

Supersedes the 245ecb1 recalibration. Verified: passes with and without
the preload pin, same deterministic schedule (nudge at inputs[7], fold at
inputs[8]).
…already in master)

The #4753 input-buffer-release fix landed in master independently via a
cherry-pick of the earlier duplicate PR #4756 (6c0079b) plus two follow-up
fixes (bdf1ac0 marker-slip repair, 3728f96 watermark-fastpath
regression). Master's version is the merged, tested, strictly-better one
(releases runPreparedPipeline; handles bodyText conditionally).

All 4 source-file conflicts resolved by adopting master's version; the stale
test file tests/issue4753-input-lifetime.test.ts (imports the now-removed
computeRawWireBookkeeping API) is deleted. The merge result is
byte-identical to master, so this PR is now a no-op and should be closed as
redundant (see thread).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Conflict resolved (no-op merge) — the PR is now redundant and should be closed.

This run I completed the conflict resolution I'd aborted last run. The root cause (found last run): master already merged the #4753 fix — via a cherry-pick of the earlier duplicate PR #4756 (6c0079b5f0) plus two follow-up fixes (bdf1ac0d57 marker-slip repair, 3728f968fd watermark-fastpath regression). Master's version is the merged, tested, strictly-better one.

What I did this run:

  1. Re-merged origin/master (301e1a5459) into the branch → same 4-file conflict (plugin.ts, server.ts, handle.ts, relay.ts).
  2. Verified our branch's changes since the merge-base are EXACTLY the 6 files of the fix: release request input buffers before long-running responses #4753 fix (nothing else to preserve).
  3. Resolved all 4 source-file conflicts by adopting master's version (the merged, tested, strictly-better one — it releases runPreparedPipeline and handles bodyText conditionally per the 3728f968fd fix; ours unconditionally set bodyText=undefined, which broke the fastpath).
  4. Deleted our stale test file tests/issue4753-input-lifetime.test.ts (it imports computeRawWireBookkeeping, which no longer exists in master — it would fail CI).
  5. Verified the merge result is byte-identical to master (git diff HEAD origin/master = empty) — a clean no-op.
  6. Committed + pushed the final head (2f76ccf1aa, unmarked → the branch's one full CI pass).

Live state (verified via single GitHub API GET this run): mergeable: true, mergeable_state: blocked (CI running on the no-op head) — no longer dirty. The mirror cache is still showing the old head (e022f2cfc6 / dirty, fetched 2026-11-16) and will catch up. Since the head's tree = master's tree (which already passed CI), this CI pass will be green.

Result: the PR's diff vs master is now empty — a true no-op. Merging it would change nothing.

Recommendation: close #4766 as redundant (the #4753 fix is already in master via #4756 + follow-ups). I can't close PRs (owner-only). #4756 is likewise now redundant (it was the cherry-pick source).

八问:

  1. 是什么问题: 这个 PR 与 master 冲突,但根因是 master 已经独立合入了 fix: release request input buffers before long-running responses #4753 的修复(通过 cherry-pick 更早的重复 PR [PR] fix: release input-only request data before streaming #4756 + 两个后续修复),我们的 PR 已经冗余。
  2. 什么原因导致的: 更早的重复 PR [PR] fix: release input-only request data before streaming #4756(z0d0dOr 的 fork)在我们清理冲突之前被 cherry-pick 进 master(6c0079b5f0),并带了两个后续修复(bdf1ac0d57 修 cherry-pick 时的 marker slip、3728f968fd 修 bodyText 无条件释放导致的 watermark fastpath 回归)。master 的版本是已合并、已测试、严格更优的。
  3. 影响范围与严重程度: 对用户无影响(修复已在 master)。这个 PR 现在是一个空 diff(no-op),合入不会改变任何东西;若此前强行合入我们的版本反而会回退 master 的两个后续修复(那才是真回归)。
  4. 怎么修复的: 把 4 个源文件冲突全部解决为采用 master 的版本(已合并、已测试、更优),删除我们过时的测试文件(它 import 了已不存在的 computeRawWireBookkeeping),验证合并结果与 master 字节级一致(空 diff),推送最终 head。
  5. 是否有回归问题: 无——采用 master 的版本就是 master 已合并的代码(它合入时已过 CI),没有引入任何新变更;删除的测试文件测试的是已不存在的 API,保留它才会红。
  6. 是否破坏缓存: 无。
  7. 是否改了设计方向: 无。
  8. 是否引入了新的配置: 无。

判定: 冲突已解决(no-op merge,head 2f76ccf1aa),PR 不再是 dirty(现为 blocked = no-op head 的 CI 在跑,必绿)。PR 现在是空 diff,建议 owner 关闭 #4766(冗余,#4753 修复已在 master)。

…ld-probe root fix + architecture-docs map line)
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI red resolved — inherited master red, fixed by merging the ci-fixes sentinel lane. All three failing test shards (ubuntu-24/3, ubuntu-22/3, windows-22/4) failed on the SAME single test: #2929: nudge + proxy-tool-round fold keeps re-request/next-turn byte-stable (tests/issue2929-codex-fold-double-miss.test.ts:232, scenario miss: no ephemeral nudge in the pre-fold request (inputs[6])). The PR branch tree is byte-identical to master (the #4753 fix is already in master; head 2f76ccf1aa is a no-op master merge), so this is the documented #2929 born-red family from #4599, not a regression from this PR. Root cause (per #4599): the probe's hardcoded request-index anchors + non-hermetic wire shape — CI pins BILI_MESSAGE_TIMESTAMPS="0", so the nudge schedule differs from local runs. The sentinel already landed the root fix on ci-fixes (7247410976: schedule-independent probe trigger + hermetic wire shape; plus 8ed56be997 architecture-docs map line). I merged origin/ci-fixes into the PR branch → new head ef134e3859, verified locally under the exact CI preload chain (timestamps OFF): #2929 test passes, architecture-docs guard green. Pushed unmarked as the final head (this branch's one full CI pass). One-line status posted to #4599.

七问

  1. 是什么问题:3 个 test 分片(ubuntu-24/3、ubuntu-22/3、windows-22/4)全部红在同一个测试 codex 命中率问题分析 #2929(tests/issue2929-codex-fold-double-miss.test.ts:232):scenario miss: no ephemeral nudge in the pre-fold request (inputs[6])——probe 在 fold 前的请求里找不到 ephemeral nudge。
  2. 什么原因导致的:继承性 master 红,非本 PR 引入。本 PR 分支树与 master 逐字节一致(fix: release request input buffers before long-running responses #4753 修复已在 master,head 2f76ccf 是 no-op master merge)。根因在 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 已有完整记录:codex 命中率问题分析 #2929 probe 用硬编码请求下标锚点触发 fold 且非 hermetic——CI 带 preload pin BILI_MESSAGE_TIMESTAMPS="0",线形与本地直跑不同,nudge 调度漂移,锚点失配。
  3. 影响范围与严重程度:master 上所有合入 master 的 PR 都继承此红(近期 [PR] kernel: keep unresolved summary anchors stable across appended turns #6941/[PR] fix: name the oversized range in the manual compress lane's refusal (#6945) #6951/[PR] fix: preflight-tier batch — deterministic tier-exhaustion verdict, repacked-tail reanchor, anthropic egress clamp #6435/[PR] Re-land v6 composite-identity fastpath lane — inverse of #5854 revert (base for snapshot-centric rework, #5643) #5855 等多单同签名);仅 test 车道红,不阻塞任何产品功能,属 CI 可用性瑕疵。
  4. 怎么修复的:按 CI 失败协调政策,merge origin/ci-fixes(7247410)进 PR 分支——哨兵已收敛根治:probe 改为调度无关触发(首个带 ≥11 个 tagged refs 的 ephemeral nudge 请求上 arm fold)+ 钉 compress.messageTimestamps:false 使线形 hermetic;顺带带入 8ed56be 的 architecture-docs module map 补行。新 head ef134e3859。
  5. 是否有回归问题:无。merge 仅带入 1 个测试文件 + 1 行文档,零生产代码;测试改动是哨兵根治(替换锚点 whack-a-mole,不再对 token 估算漂移敏感)。
  6. 是否破坏缓存:不涉及——纯测试文件与文档改动,不触碰缓存/重试/游标逻辑。
  7. 当前状态与遗留:final head ef134e3859 已推送(无 [ework:ci-held] 标记,即本分支唯一一次全量 CI),等 CI 重跑结果;ci-fixes→master 收敛 PR [PR] ci-fixes: converge master CI fixes (#2929 fold probe schedule-independence + architecture-docs module map) #6974 仍待合并(master 自身 codex 命中率问题分析 #2929 仍红,属 master 级工作,不在本 PR 范围)。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES — this PR is redundant and should be closed, not merged.

This is a disposition issue, not a code defect — there is nothing to fix in the code. I independently verified the current head (ef134e385) against origin/master and origin/ci-fixes rather than relying on prior thread claims.

1. The #4753 fix (this PR's stated purpose) is already in master.

  • 6c0079b5f0 "fix: release input-only request data before streaming (#4753)" — a cherry-pick of the earlier duplicate PR #4756 (9c8c72c78) — is in master.
  • bdf1ac0d57 "fix(handoff): complete #4753 release-wiring dropped by a marker slip" — in master.
  • 3728f968fd "fix: keep the raw body text available to the plugin full-resend watermark fastpath" — in master.
  • master's src/server/handle.ts:3482 carries releaseRequestInput; src/plugin.ts:570 carries preparePluginWireMetadata.
  • The PR's diff vs master contains none of the #4753 source files (plugin.ts / server.ts / handle.ts / relay.ts). The no-op merge 2f76ccf1aa adopted master's version of all four, so this PR's own #4753 implementation is gone from the diff.

2. The only remaining diff vs master is 2 files, both byte-identical to the ci-fixes branch.

  • tests/issue2929-codex-fold-double-miss.test.ts — the #2929 fold-probe root fix (schedule-independent fold.state machine + hermetic compress.messageTimestamps:false pin). Byte-identical to ci-fixes tip 7247410976.
  • reference/architecture.md — one module-map line for src/responses-system-sections.ts (#6922). Present in ci-fixes.
  • Both converge to master via the dedicated ci-fixes→master PR #6974 (open, head=ci-fixes, base=master, carrying exactly these 2 files) — not through this PR.

3. Correct disposition.
Merging this PR adds nothing: its purpose (#4753) is already in master, and its remaining content is redundant with #6974. The clean action is to close #4766 as redundant (owner action — agents cannot close). The #4753 fix ships via the already-merged master commits; the #2929 test fix + docs line ship via #6974.

Scope checks: no kernel/ changes, no kernel-change declaration, no config surface, no wire/persistence change. CI green on head ef134e385 (0 failed / 0 pending). No small findings to fix on the spot — the 2-file diff is the clean ci-fixes canonical version.

八问

  1. 是什么问题: 这个 PR 现在冗余了——它声称要修的 #4753(大请求的输入缓冲跨整个响应流驻留 → 慢性内存增长/OOM)已经在 master 里。
  2. 什么原因导致的: 更早的重复 PR #4756 先被 cherry-pick 进 master(6c0079b5f0),又带两个后续修复(bdf1ac0d57 补 marker slip 丢掉的接线、3728f968fd 修 bodyText 无条件释放砸掉 watermark fastpath);本 PR 的 CI 工程师解冲突时把 4 个源文件全部采用 master 版本(no-op merge 2f76ccf1aa),自己那份 #4753 实现就从 diff 里消失了,只剩后来为骑掉继承红而 merge 进来的 ci-fixes 内容。
  3. 影响范围与严重程度: 对用户零影响(#4753 修复已在 master);这个 PR 本身是冗余条目,合入不会改变任何东西,只会在 #6974 之前把同样的 ci-fixes 内容提前带进 master(无害但多余)。
  4. 怎么修复的: 无需修复——#4753 修复已在 master;剩余 diff(#2929 测试根治 + 一行架构文档)与 ci-fixes 分支(7247410976)逐字节一致,走 #6974 收敛进 master。
  5. 是否有回归问题: 无——本 PR 相对 master 没有引入任何新变更(4 个源文件零 diff),合入等于 no-op;真正要防的反而是「强行合入本 PR 旧版本」会回退 master 的 3728f968fd 修复,当前 head 已避免这一点。
  6. 是否破坏缓存: 不涉及——无出站字节/缓存/重试/游标改动。
  7. 是否改了设计方向: 不涉及——无架构/边界/数据流转向。
  8. 是否引入新配置: 不涉及——无新 env/config/默认值。

判定: 建议 owner 关闭 #4766(冗余:#4753 修复已在 master,剩余内容走 #6974 收敛)。本审核不动代码(2 文件 diff 是 ci-fixes 规范版,无可修小缺陷),不执行关闭(owner-only)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Review complete — verdict: PR #4766 is redundant, recommend close (owner action).

I independently verified head ef134e385 against origin/master and origin/ci-fixes (not relying on prior thread claims):

  1. The fix: release request input buffers before long-running responses #4753 fix (this PR's purpose) is already in master — 6c0079b5f0 (cherry-pick of duplicate [PR] fix: release input-only request data before streaming #4756) + bdf1ac0d57 + 3728f968fd; src/server/handle.ts:3482 carries releaseRequestInput. The PR's diff vs master has none of the four fix: release request input buffers before long-running responses #4753 source files (no-op merge 2f76ccf1aa adopted master's versions).
  2. Only 2 files remain, both byte-identical to real ci-fixes (7247410976): the codex 命中率问题分析 #2929 fold-probe test + one architecture-docs line. They converge via the dedicated ci-fixes→master PR [PR] ci-fixes: converge master CI fixes (#2929 fold probe schedule-independence + architecture-docs module map) #6974, not this PR.
  3. No kernel/ change, no kernel-change, no config/wire/persistence change, CI green. No small findings to fix.

Full findings + 八问 in my COMMENT review above (REQUEST_CHANGES was rejected by GitHub — can't request changes on my own PR; APPROVE would mislead on a redundant PR).

八问

  1. 是什么问题: PR 现在冗余——它声称要修的 fix: release request input buffers before long-running responses #4753(大请求输入缓冲跨整个响应流驻留 → 慢性内存增长/OOM)已在 master。
  2. 什么原因: 重复 PR [PR] fix: release input-only request data before streaming #4756 先被 cherry-pick 进 master(6c0079b5f0)+ 两个后续修复(bdf1ac0d57、3728f968fd);本 PR 解冲突时 4 个源文件全采用 master 版本(no-op merge 2f76ccf1aa),自己的 fix: release request input buffers before long-running responses #4753 实现从 diff 消失,只剩为骑掉继承红 merge 进来的 ci-fixes 内容。
  3. 影响范围与严重程度: 对用户零影响(fix: release request input buffers before long-running responses #4753 修复已在 master);合入本 PR 等于 no-op,只在 [PR] ci-fixes: converge master CI fixes (#2929 fold probe schedule-independence + architecture-docs module map) #6974 之前把同样 ci-fixes 内容提前带进 master(无害但多余)。
  4. 怎么修复: 无需修复——fix: release request input buffers before long-running responses #4753 已在 master;剩余 2 文件 diff 与 ci-fixes(7247410976)逐字节一致,走 [PR] ci-fixes: converge master CI fixes (#2929 fold probe schedule-independence + architecture-docs module map) #6974 收敛。
  5. 回归风险: 无——相对 master 零新变更,合入 = no-op;真正要防的是「强行合入旧版本」回退 master 的 3728f968fd,当前 head 已避免。
  6. 是否破坏缓存: 不涉及。
  7. 是否改设计方向: 不涉及。
  8. 是否引入新配置: 不涉及。

判定: 建议 owner 关闭 #4766(冗余)。本审核不动代码、不执行关闭(owner-only)。

This branch has not been deployed

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

Labels

bug Something isn't working duplicate This issue or pull request already exists p2 scope/wiring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: release request input buffers before long-running responses

1 participant