You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[preflight] The futile-round exit uses "fold count" rather than "gap closable" to determine retryable: rounds with zero | [preflight] futile-round 出口用「折叠数量」而非「缺口可闭合」判 retryable:净收益 0 的轮次仍回答 502,宿主空转整轮重试 #4563
2026-10-24T13:37:31.001Z [error] [sess=ses_e9bc75f0dffe1cNZPUGIDPTf5J] [v=0.1.204] preflight fail-fast 502 (retryable=true): context ~169645.89064016158 tokens (down from ~171444.12760520758 before preflight) exceeds the model window 168000 (model=deepseek-v4.1-flash), with 1 compressible range(s) still visible and preflight compression could not bring it under: futile round: folding compressible raw messages plus tier distillation (0 summary call(s), net ~0 tokens saved) still leaves the payload ~4207.570723900775 tokens over the window — the distillation summary was unavailable. ... 1 range(s) folded this turn persist in the session — the next attempt starts from a smaller baseline and continues the fold (~0 tokens short of the target). The over-window payload was NOT forwarded.
同会话相邻两次同因不同说法(说明不是单次抖动):
13:33:45 ... net ~1514.8289576109382 tokens saved ... — tier-2: no two-block span stayed under the 60,000-character source budget
11:24:14(当时窗口 170252)... net ~26455.70769934877 tokens saved ... — no tier held two or more active blocks to distill
Additional sanitized field report on bili 0.1.212 (daa082e), OMP host, Responses lane, custom gateway alias: preflight emits HTTP 502 even while logging retryable=false. OMP retries it 10 times and exhausts its retry budget. The same payload remains blocked: approximately 156317 / 157320 input tokens versus a 150000 input target; relaxed raw-fold pool about 2347 tokens, deficit about 7148; tier recovery logs 0 summary calls and 0 tokens saved, then 'the distillation summary was unavailable'. No summary-call failure warning accompanies it. The bundled attemptTierRecovery path can produce this wording when previewFoldTargetKey returns undefined before dispatch, so the message does not necessarily mean a summarizer outage. The gateway declares a 1050000 context window, but the unknown alias had fallen back to 200000, yielding the 150000 headroom-adjusted wall. Explicit per-route context fixes that local mismatch. Independently reproduced #5791's historical mid-turn merge refusal against the installed 0.1.212 bundle and verified the identical fixture succeeds on released 0.1.213 without coverage loss. Remaining protocol issue: a non-retryable fail-fast response should use a status/class the host can actually honor rather than 502 alone; also preserve the actual projection refusal in diagnostics instead of calling an unattempted summary unavailable.
changed the title [-][preflight] futile-round 出口用「折叠数量」而非「缺口可闭合」判 retryable:净收益 0 的轮次仍回答 502,宿主空转整轮重试[/-][+][preflight] The futile-round exit uses "fold count" rather than "gap closable" to determine retryable: rounds with zero | [preflight] futile-round 出口用「折叠数量」而非「缺口可闭合」判 retryable:净收益 0 的轮次仍回答 502,宿主空转整轮重试[/+]on Nov 13, 2026
Activity
ranxianglei commentedon Oct 28, 2026
[bot] (ai: vllm-qwen/qwen3.8-27b)
状态:进程因长时间无输出被强制重启(此前已卡死 3 次、上下文重置)。重启后我核对了本地工作区:没有未提交改动,也没有为这条 issue 提交过任何 commit——之前几次卡死都发生在产出任何代码改动之前,所以没有需要抢救的阶段性成果。现在从头按 triage 流程推进。
查重:不重复。检索 open+closed 未发现同机制条目。本条与下列相关但机制不同,不构成重复:
FAIL_FAST(status, retryable, class)):本条是它的一个具体反例——progressContinues属于“走环结果”,不应单独决定重试语义;~4207 over与~0 short of target并列正是它的现场,但那是另一处缺陷;审核结论(独立三问):
复现/查证:已在当前 master 核对代码路径,机制成立(行号相对报告者 v0.1.204 有漂移)。verdict 判定在
src/server.ts:4042/4095/4102/4110;deterministic赋值在src/preflight.ts:2271/3044/3090/3099;previewFoldTargetKey(...) === undefined → stopReason="unavailable"在src/preflight.ts:1962-1966。因果链与报告一致。层次判断(根因):真正的落点在
src/preflight.ts:3073—— 分层蒸馏恢复失败时构造failure = { kind:"exhausted", detail: rec.honestDetail },根本没有设置deterministic字段(其余四个 exhausted 构造点都设了)。于是f.deterministic落到undefined(假值),server 侧progressContinues = exhausted && !f.deterministic && compressedRanges>0只要本轮早前折过哪怕一个范围就为真 → 判成“relay 依赖、可重试”→ 502/retryable=true。报告者描述的“net ~0 saved + 蒸馏无目标块”这一类结构性注定失败的轮次,就这样掉进了代码注释里点名的“状态码驱动的宿主无限自转”路径。根因一句话:tier-distillation 恢复失败路径漏设deterministic,把结构性 unavailable(previewFoldTargetKey解析不出目标块)误当成了瞬时 relay 依赖。方案评估:报告的修法方向正确且打到核心。我会据此实现:让恢复函数把自己的终止原因(结构性 vs 瞬时)显式带回——
stopReason ∈ {exhausted, no-shrink}以及unavailable中的“无目标块 / apply 被判 fatal”属结构性;distillation 调用抛错、等待期间目标漂移属瞬时。结构性 →deterministic=true→ 413/不可重试;瞬时保持 502(保留 413 Deadlock: When an authenticated session exceeds the reservation window with zero collapsibles, the #3146 forwarding | 413 死锁:带身份会话超预留窗口且零可折叠时,#3146 转发门因 anonymous 条件不触发,会话从首条消息起永久不可用 #4185 的 relay 语义)。同时补上诊断缺口:unavailable的 why 文案区分“无目标块”与“relay 失败”,不再一律说 “the distillation summary was unavailable”。行为变更披露(有意变更):该类轮次(分层蒸馏恢复失败且结构性无进展)的响应由 502(retryable=true)改为 413(retryable=false)。理由:这类轮次重试必然复现同一结果,502 只会让按状态码判瞬时的宿主(opencode
ProviderInternal)空转整轮重试预算。瞬时 relay 类(摘要调用报错等)不受影响,仍是 502。计划:修复落在
src/preflight.ts(恢复结果带上 structural 判定 + why 细分);src/server.ts无需改——deterministic传上去后现有 status/retryable 逻辑会自动落到 413。加回归测试钉住正反两向(gate 双向断言纪律),定向单测验证后开 PR(Closes #4563)。全程用带超时的定向操作,避开导致卡死的长命令。方向明确、机制已核,进入实现。
felix-kunz-ai commentedon Nov 13, 2026
Additional sanitized field report on bili 0.1.212 (daa082e), OMP host, Responses lane, custom gateway alias: preflight emits HTTP 502 even while logging retryable=false. OMP retries it 10 times and exhausts its retry budget. The same payload remains blocked: approximately 156317 / 157320 input tokens versus a 150000 input target; relaxed raw-fold pool about 2347 tokens, deficit about 7148; tier recovery logs 0 summary calls and 0 tokens saved, then 'the distillation summary was unavailable'. No summary-call failure warning accompanies it. The bundled attemptTierRecovery path can produce this wording when previewFoldTargetKey returns undefined before dispatch, so the message does not necessarily mean a summarizer outage. The gateway declares a 1050000 context window, but the unknown alias had fallen back to 200000, yielding the 150000 headroom-adjusted wall. Explicit per-route context fixes that local mismatch. Independently reproduced #5791's historical mid-turn merge refusal against the installed 0.1.212 bundle and verified the identical fixture succeeds on released 0.1.213 without coverage loss. Remaining protocol issue: a non-retryable fail-fast response should use a status/class the host can actually honor rather than 502 alone; also preserve the actual projection refusal in diagnostics instead of calling an unattempted summary unavailable.
[-][preflight] futile-round 出口用「折叠数量」而非「缺口可闭合」判 retryable:净收益 0 的轮次仍回答 502,宿主空转整轮重试[/-][+][preflight] The futile-round exit uses "fold count" rather than "gap closable" to determine retryable: rounds with zero | [preflight] futile-round 出口用「折叠数量」而非「缺口可闭合」判 retryable:净收益 0 的轮次仍回答 502,宿主空转整轮重试[/+]ranxianglei commentedon Nov 13, 2026
[bot] 🏷 状态更新(非最终结论,实现进行中):
根因已对照当前 master(243709b)钉死:
attemptTierRecovery是 5 个 exhausted 出口里唯一不带deterministic标志的那个——消费处src/preflight.ts:3231只写{ kind:"exhausted", detail },f.deterministic落 undefined →src/server.ts:4675永不选 413,而src/server.ts:4682的progressContinues只看compressedRanges>0→ 结构性 futile 轮次被答 502/retryable=true(OP 的 84s×10 空转);compressedRanges==0时则是 OMP 字段报告里那个「retryable=false 仍是 502」。修复设计(已在代码里验证):在
attemptTierRecovery内跟踪一个structural布尔——同 payload 重试无解(无候选 span / 投影解析不到可折叠目标 / apply 被投影拒绝 / 蒸馏净收益 0)→ structural=true;依赖 relay 的(摘要调用抛错 / 摘要不可用 / 目标竞态 / 撞调用预算)→ structural=false。消费处补上缺失的deterministic: rec.structural→ 结构性轮次落 413/retryable=false,relay 依赖型保持 502。server.ts无需改动。顺带把unavailable的 why 文案按真实原因区分(修掉「没尝试摘要却报 summary unavailable」的诊断缺口)。已完成:preflight.ts 已落 4/12 处编辑(TierRecoveryResult 加字段 + 声明 + exhausted/no-target 两个结构性出口)。
剩余:完成其余 8 处编辑 → typecheck → 写双向回归测试(结构性→413、relay 错→502)→ 定向跑该测试 → 提 PR(Closes #4563)。
风险/行为变更:结构性 futile 轮次 502→413(retryable 由 true/false 统一为 false),PR 里披露;不触碰 kernel/。
卡住说明:前几次强杀是无界测试/构建命令所致,本次所有命令均带硬超时,不会再挂。
ranxianglei commentedon Nov 13, 2026
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)
已修,PR 已开: #6617 (Closes #4563)
先回应 @felix-kunz-ai 的字段报告(bili 0.1.212 / OMP):它印证了根因,并补了第二种表现——502 且日志 retryable=false 时 OMP 仍按 502 状态码空转耗尽重试预算。本 PR 的修法(结构性徒劳轮次 → 413)对这两种表现都成立:413 是宿主认得的终止码,不再空转;日志里"0 次 summary 调用 + unavailable"正是投影把 span 解析成空(不是 summarizer 故障),PR 里已把这句 why 说清。报告里"unknown alias 回退 200K 窗口"是另一个独立问题(配置/别名解析),不在本 PR 范围,建议单独跟踪。
结构化八问:
preflightCompress有 5 个 exhausted 判决点,4 个都设了deterministic,唯独 tier-distillation-recovery-failed(近窗口徒劳轮次实际命中的就是它)漏掉。deterministic=undefined(falsy)→ server 永不走 413;而progressContinues = exhausted && !deterministic && compressedRanges>0按折叠数量而非净收缩触发 → 净 0 轮次被标成"可能还有进展" → 502/retryable。attemptTierRecovery内部单独追踪结构性终止原因,作为deterministic带进判决——结构性(同一 payload 注定失败:无候选 span / 投影解析成空 / 投影拒绝 apply / 净 0 且之前没省到)→true;依赖 relay(可能恢复:summary 抛错 / 不可用 / 等待期目标变 / 撞预算上限)→false。server.ts 已有exhausted && deterministic && !payloadFitsWindow → 413映射,无需改 server;顺带把"unavailable"的 why 按各终止点说清。noteLocalRefusal持久化本地拒绝证据(既有行为)。行为变更披露:结构性徒劳轮次 502(retryable true/false)→ 413(retryable=false);relay-dependent 失败不变(仍 502)。
验证:
npm run typecheck绿;定向套件绿(issue2952-preflight-tier-recovery6/6,含 2 个 #4563 双向回归测试;preflight-empty-summary9/9)。全局回归交 CI。标签:bug / opencode / scope/kernel / p2 —— 缺陷:preflight futile-round 判决的压缩核心逻辑,opencode/OMP 宿主空转,能用但有明显问题(近窗口徒劳轮次,需绕行)。
判定:可进入 review/合并——单模块
fix:、双向回归测试、typecheck 绿、行为变更已披露。