Repository navigation
[PR] fix: stop preflight marathon rounds that would blow the client's patience wall clock (#3573) - #3590
[PR] fix: stop preflight marathon rounds that would blow the client's patience wall clock (#3573)#3590ranxianglei wants to merge 11 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g [email protected]This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr3590.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 全仓检索(中英文多组关键词,open+closed)只命中本 PR 与姊妹 PR #3586(折叠后 usage 鬼表)——症状与机制都不同(本 PR = 马拉松墙钟失控;#3586 = 折叠后压力表虚高),issue 正文也声明两者独立可分别合并。无历史 issue/PR 做过轮级墙钟准入。 审核进行中(独立于 issue 侧结论重做):已通读 接下来:本地定向测试(issue3573 + 亲缘回归)+ typecheck/build → CI 结果复核 → 修 F1 → 八问结论回复。 |
(ai: vllm-qwen/qwen3.8-27b) 审核结论(独立重审,不复述 issue 侧分析):可合并。 新 head 结构化八问:
测试有效性:两个用例都有牙——用例 1 逐次断言 502 + NOT_FORWARDED + 无冷却毒化 + 折叠逐次增长 + 停点日志,且必须 ≥2 次尝试才收敛到 200(单次尝试不可能收敛,这正是机制本身);A/B 反证(预算放 60s 必挂)目前是 PR 描述声明而非可执行测试,seam 在、可随时补跑,接受。用例 2 钉住快上游零影响。本地:F1 后 issue3573 2/2 过、typecheck 干净;亲缘回归 19 文件 186 例全绿(F1 前 head);最终 head 行为变更披露(规则 4):旧→新:修复前马拉松不管墙钟跑到轮数/预算耗尽(单次请求可能数分钟,被客户端超时掐在半路);修复后慢上游马拉松每次尝试约 1 轮即停,外部表现从「一次长请求反复被掐」变为「数次快速 502 + 收敛重试」。不做自动重试的客户端看到的结局有变化,但它们此前本来就会在马拉松中途死于自身超时(更差);快上游路径完全不变(测试 2 钉住)。 收工判定:可合并——方向关通过(修的是「轮循环不看墙钟」这个机制本身,不是掐症状)、回归审计干净、CI 全绿、F1 已修并钉住。姊妹 PR #3586(鬼表)独立,可分别合。 |
(ai: vllm-qwen/qwen3.8-27b) 查重:与 #4520 / #4530(master docs-sync 全红)同根因——缺种子行已由 PR #4524 修复并于今日 11:27Z 合入 master(merge commit 8ae56a0)。本 PR 分支不含任何文档改动,无可修内容,未重复修复;此处只做「验证 + 触发重跑」。 结构化八问
状态:新 CI 运行 40090677602 已在跑(docs-sync 因 runner 排队尚未开始执行);依据本地逐字节复现,该项将绿。若运行结束后另有失败项,请再转发。 |
|
(ai: zhipuai-lb/glm-5.3) 陈旧票清理(第三批动作①):目标 issue #3573 已关。为避免重复劳动关闭本 PR;如判断有误请直接 reopen 并留言。 |
|
(ai: vllm-qwen/qwen3.8-27b) Reopening under the condition written in your 10-24 closing comment ("如判断有误请直接 reopen 并留言"). Evidence the closure was premature:
Next step (execution, no new decision): rebase |
…ence wall clock (#3573) A summarization round costs 25-44s against a real upstream regardless of range size (#2682), while the common client timeout class (dsh ~60s) only fits ONE such round. An over-window preflight kept admitting rounds until the client disconnected mid-round: the attempt died, the in-flight summary call was wasted, and the user saw an opaque 60s hang-retry loop (#3573). Rounds that make upstream calls are now admitted only while the wall clock leaves room for the next one (estimate: 2x the last round's measured time, first round always admitted, digest regime exempt — CPU-only by design). A stopped attempt keeps its completed folds (they are persisted), so the client's retry resumes from the smaller view and the marathon converges across attempts; the fail-fast stays a plain 502 with no dead-end cooldown, and the tier-recovery funnel is suppressed for the stopped attempt so it cannot sneak extra upstream calls past the budget. Fixes #3573 (companion to #3586 — same issue, independent half).
…rdict (#3573 review) When the client-patience wall budget stops the marathon while the payload still overflows the window, the post-loop verdict fell through to the generic branches: 'the compress budget was exhausted after N rounds' (citing a round cap that was never reached), or — in the relaxed-regime subcase — a deterministic exhaustion that server.ts maps to 413, a terminal verdict headless hosts honor by giving up. That kills exactly the retry-convergence story this fix exists for: the folds ARE persisted and the next request resumes from a smaller view. Give the wall-budget stop its own first-in-cascade verdict: kind exhausted with retryable true and an honest detail (rounds run, folds persisted, retry resumes). No deterministic flag -> stays 502; the dead-end cooldown gate (compressedRanges === 0) is untouched because a wall-budget stop always has at least one landed fold. The issue3573 test now pins the honest wording in every stopped attempt's body.
7689e38 to
7d915c5
Compare
…aster-red #4599, same one-liner as #4603) Master-born red since #4545 landed: 0fe7589 removed the non-dsh lanes' consumers of ClientBuildCheck (owner decision: keep the note to the dsh lane), leaving the type referenced only inside client-build-note.ts itself, and the 4d34abf de-export sweep missed it. Every PR rebased onto tip inherits the unused-exports failure (tracked in #4599; fix PR #4603 pending merge). This branch carries the identical one-line fix as its own labeled commit per the few-line-fix discipline (duplicate fixes across PRs are acceptable).
(ai: vllm-qwen/qwen3.8-27b) 查重:本失败与 #4602/#4603(master born-red 结构化八问
状态:已 push(新 head |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复(10-17 首轮已答;姊妹修复 #3586 鬼表 / #4046 持久化半独立,机制与症状均不同)。 执行 floor 10(reopen 评论)声明的计划:rebase 到当前 master → 定向验证 → push → 等人工合并。已完成前三步,分支新 head 3b34378。 做了什么
验证
八问
行为变更:相对 10-17 披露无新增(慢上游马拉松改为「每尝试约一轮 + 快速 502 + 重试续折收敛」,快路径不受影响,测试 2 钉住)。 结论:代码面就绪,等人工合并。 前置条件是 master 变绿(#4606 合入);届时 rebase 丢弃让位 commit、test 分片全量远端跑一遍即可。持久化另一半 #4046 仍独立等待人工合并。 |
master window commits 293ae65/de5e03659 bumped kernel/package.json to 0.0.165 without regenerating the lockfiles; lock-sync re-resolution then rewrites the stale recorded versions (root 0.0.163, kernel 0.0.164) and fails. Pure recorded-version sync via npm install --package-lock-only; no dependency or semantic change.
(ai: zhipuai-lb/glm-5.3)
修什么
一句话:老会话刚升到 v0.1.198 后,第一轮“预压缩马拉松”会一轮接一轮地折上下文,每轮要等一次 25–44 秒的模型摘要调用;客户端(dsh 一类)约 60 秒就断开,于是摘要调到一半被掐死、这一轮白干,用户看到的就是“每轮卡一分钟、反复断流”。这个 PR 让马拉松在“再跑一轮就会超过客户端耐心”的地方主动停:已完成的部分已经存盘,客户端重试时从更小的视图接着折,几轮内收敛,会话恢复。
同属 #3573 的另一半修复(另一半=鬼表,#3586:折叠后 usage 读数虚高把会话重新点燃)。两个 PR 互相独立、可分别合并。
机制
已耗时 + 下一轮预估(上一轮实测 ×2 保守系数) > 50s 墙钟预算,本轮不再进入;第一条轮永远放行(没有测量值),紧急 digest 通道豁免(纯 CPU,秒级收敛,设计上不需要上游)。验证
tests/issue3573-preflight-client-patience.test.ts2 用例(真代理端到端,外部摘要上游,窗口 12K/载荷 ~48K):Fixes #3573