Skip to content

decision request: lookup-miss window fallback — treat unknown as unknown instead of the 2e5 default #5502

Closed

Description

@ranxianglei

来源: #5500 分析 <原问题> 时发现

Background

#5500 showed a window lookup miss is not neutral: an unknown model id falls to the base.modelContextLimit env default 2e5 → ~150K effective window, so payloads that FIT the real window (field case: 1M step-family deployment) get judged over-window and die in the preflight fail-fast loop — non-retryable for the client. The #852 doctrine (too-large guesses self-heal on the first upstream overflow; too-small ones strand) only holds while a forward still happens; the local fail-fast starves that feedback.

PR #5501 ships the narrow fixes (step-family table row + estimate-grade entry-sizing discipline). The systemic question remains: what should a lookup miss mean?

Options

Recommendation

A now (what #5501 ships) + C as follow-up; B only if stranding recurs on families where C is infeasible. B changes the preflight trigger's safety posture globally (fail-open at trigger level), which is exactly the default-value product decision §7.4 reserves for the owner.

Activity

  1. ranxianglei commented on Nov 2, 2026

    @ranxianglei
    OwnerAuthor

    🤖 Powered by ework · qwen3.8-27b

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

    查重:不重复。 按失败签名(lookup miss / window fallback / unknown default / preflight fail-fast stranding)检索 open+closed issue 与 PR,无既有决策线程。同源家族是 #5500(bug 报告)/ #5501(narrow-fix PR),但那是「修具体缺陷」;本单是刻意从它们里拆出来的系统性产品决策(lookup miss 该当什么语义),scope 不同,单独拍板合理。

    标签:bug / scope/wiring / p1 / needs-decision(缺陷姿态的系统性决策;窗口解析+preflight trigger 在 src 侧请求管道=scope/wiring;沿用同源 #5500/#5501 的 p1 定级;needs-decision 标记等你拍板)。

    独立核验(自己读代码,非照抄 issue 结论)——前提在 current master 上端到端成立:

    • base 默认 2e5:src/config.ts:1498(parseInt(env.ACP_MODEL_CONTEXT_LIMIT ?? \${fileConfig.modelContextLimit ?? 200000}`,10)`)。
    • lookup miss 返回 undefined:src/config.ts:638-646(CONTEXT_LIMIT_TABLE 无匹配行 → undefined)。
    • 解析链全 miss → 落 base:src/server/handle.ts:772-789(betaWindow ?? suffixWindow ?? pluginWindow ?? runtimeWindow ?? launcherWindow ?? configuredWindow ?? peekWindow ?? lookupContextLimit(model) 全空则 native=undefined,resolveRequestConfig 落回 base,且 nativeFromFallback=true);有效窗口再被 maxContextLimitPct(.75)+ output-headroom floor 压到 ~150K。
    • [Question] deepseek-flash 被静态兜底表解析为 128k,真实窗口 1M —— 是有意设置,还是兜底表过期? #852 教义原文就在表注释里:src/config.ts:598-600("too-small guess strands … too-large self-heals")。
    • 逃生口存在:compress.modelContextLimit per route/model(operatorWindowTuned 路径,handle.ts:750/821-832)。
    • B 依赖的「溢出学习」机制真实存在:armOverflowShrink(src/server/relay.ts:1148,overflow 时 :1394/:1524 触发)把学到的 overflowWindow 折回 reqConfig.modelContextLimit(handle.ts:2574-2575)。
    • [PR] fix: refuse estimate-grade arms in preflight entry sizing; add step-family 1M window (#5500) #5501(A 的载体)状态:commit b5e1ee7b3 在分支 2026-11-02_step-window-char-bound-poison,尚未进 origin/master(open PR,含 ^step-→1M 行 + entry grade 纪律)。

    即 issue 的前提(miss→2e5→~150K 有效窗口→本地 fail-fast 饿死溢出学习反馈)代码层面全部核实通过。


    八问(决策请求版,Q3/Q5 按选项分列)

    1. 是什么问题:模型 id 既无权威窗口来源(per-route 声明 / warm registry / 内置表都无一行)时,bili 不是把它当「未知」,而是塌缩成「错误数字」——落回 base 默认 2e5(~150K 有效窗口)。真实窗口更大的部署(如 1M step 系)于是被本地判超窗、卡在不可重试的 preflight fail-fast;[Question] deepseek-flash 被静态兜底表解析为 128k,真实窗口 1M —— 是有意设置,还是兜底表过期? #852「偏大猜会在首次上游 overflow 自愈」赖以成立的前提(仍有一次 forward)被本地 fail-fast 饿死。

    2. 什么原因导致的:lookup miss 与「真·小窗口」在解析链末端被同一个出口(base 2e5)吞掉——undefined 没有独立的语义通道,只能塌缩成 base 默认。根因是「未知」缺一个一等公民处理分支,而不是某张表少了某一行(表可无限长,未知家族永远追不完)。

    3. 影响范围与严重程度(按选项):

      • A(维持 2e5 + 长表):现状。面=所有未显式配窗口的未知家族;严重度=p1(不配则该类部署完全不可用,配 compress.modelContextLimit 才恢复=有绕行);代价=每个新未知家族都要等现场证据命中才解,stranding 周期性复发。
      • B(miss→unknown,fail-open):面=所有走本地 preflight 的未知窗口模型;严重度=把「偏小误拒」换成「首个请求吃一次真 4xx 溢出」——对真·小窗口未知模型是一次性额外往返成本,且 preflight 失去在墙前折叠的能力;属全局安全姿态变更(fail-open at trigger level)=§7.4 owner 领地。
      • C(从上游 /models 学窗口):面=所有能暴露 /models 目录的部署;严重度=正面结构性消除整类 stranding(权威 per-deployment 窗口,不再硬编码家族);代价=新发现面 + per-host 管线,属 feat。
    4. 怎么修复的(推荐项=A+C 组合思路):A 已是 [PR] fix: refuse estimate-grade arms in preflight entry sizing; add step-family 1M window (#5500) #5501 在途(open PR,未合)。C 作为后续 feat:在解析链里 configuredWindow 与 peekWindow 之间/之上插入一个「deployment 目录」来源(参照 codex model_catalog_json 先例 [PR] fix(#5243): honor codex's model_catalog_json when aligning windows #5305),让能自报窗口的部署拿到权威值,miss 才回落 base。关键:C 不是对 A 的否定,而是把「人工长表」升级成「自动学习」;C 落地前 A 的 2e5 仍是唯一兜底。 B 冻结,除非 C 在某类无法暴露目录的家族上证明不可行、且 stranding 再次发生。

    5. 是否有回归问题(按选项):

    6. 是否破坏缓存:三项都不直接动前缀缓存接缝 / 去重键 / 增量游标。B 的唯一间接影响:fail-open 后首请求若触发真 overflow,armOverflowShrink 学到的墙会改写后续 reqConfig.modelContextLimit——但那本就是既有学习环,非新破坏。

    7. 是否改了设计方向:A 不改;C 把「静态表 + registry」的窗口来源栈扩一档(deployment 目录来源),方向是「让权威源更靠近现场」,与 zcode 用的是gpt-5.6-sol 上下文设置了272000,识别错了上下文空间了 #344/[Question] deepseek-flash 被静态兜底表解析为 128k,真实窗口 1M —— 是有意设置,还是兜底表过期? #852 的 fresher-source-wins 哲学同向;B 是「本地 fail-fast 是硬门 → 本地只作软提示、以上游为准」的方向性转向,最需要 owner 明确背书。

    8. 是否引入了新的配置:A 无;B 建议配开关(如 window.missPolicy: "default"|"unknown" 或 env)而非硬切;C 需要 per-route 目录端点声明(catalog URL / 启用位),属新配置面 → 按 Configuration Surface Discipline 须单列映射并 owner 签核后才能建。


    选项对比表

    A 维持 2e5+长表 B miss→unknown(fail-open) C 从上游 /models 学
    解决 stranding 逐家族补,周期性复发 一次性消除(换成本) 结构性消除
    真·小窗口未知模型 正确拦截 多付一次 4xx 取决于目录是否暴露
    改动性质 数据表(+在途 #5501) 全局默认/安全姿态(§7.4) feat + 新配置面
    回归风险 无(相对现状) 高(trigger fail-open) 中(新来源优先级+网络面)
    谁拍板 已在途 owner(§7.4) owner(feat+config)

    我的建议(明确,不甩选择题):A 先行(维持 #5501 正常推进合并)+ C 立项为后续 feat + B 冻结为逃生阀。 理由:A 零风险且已在途;C 是唯一结构性根治且与现有 fresher-source-wins 哲学同向,值得做但要按「发现面 + 配置面」正规立项;B 把安全姿态从 fail-closed 翻成 fail-open 是方向性转向,在 C 未证明不可行的前提下不该先动——保留为「C 在某类无法自报窗口的家族上失效时才启用的逃生阀」。

    待你拍板的三件事:① 认可 A 维持(#5501 正常推进合并)?② C 是否现在立项(我可起草 feat 提案:catalog 来源优先级位置 + 配置面映射 + 回落策略)?③ B 是否冻结为「C 失效时的逃生阀」而非默认?

    无决策依赖的可改点:无 —— A 已在途(open PR),B 是 §7.4 领地,C 是需批准的新特性;故本线程停在决策,不擅自动代码。等你 ①②③ 的答复我再动。

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions