Skip to content

[PR] fix(overflow): recognize the DashScope input-length-range 400 so the probe path can arm - #4263

Open
Zhishulo wants to merge 5 commits into
ranxianglei:masterfrom
Zhishulo:2026-10-22_dashscope-input-range-400
Open

Zhishulo wants to merge 5 commits into
ranxianglei:masterfrom
Zhishulo:2026-10-22_dashscope-input-range-400

Conversation

@Zhishulo

Copy link
Copy Markdown
Contributor

What

inspectContextOverflow() recognizes most provider overflow phrasings, but not DashScope compatible-mode's:

{"error":{"message":"<400> InternalError.Algo.InvalidParameter: Range of input length should be [1, 1000000]","type":"invalid_request_error","param":null,"code":"invalid_parameter_error"}}

On the #2313 probe path that turns a recoverable overflow into a livelock: the 400 is not classified as an overflow, armOverflowShrink never arms, the 400 is passed through, and the next turn re-sends the identical over-long payload — the user sees a timer and no reply, forever.

Root cause

  • CONTEXT_OVERFLOW_PATTERNS (src/util.ts:274) has no input-length-range marker. The wording has no token/length subject phrase, so none of the existing entries match.
  • parseOverflowWindow() (src/util.ts:338) has no [1, N] form, so even a matched body would not state the ceiling.

Observed on v0.1.202 (dsh plugin native, Windows 11, https://dashscope.aliyuncs.com/compatible-mode/v1, deepseek-v4.1-flash-1017): a forked session that could not inherit blocks (#3011 multimodal variant) started at the raw 1,632,489-token history, preflight folded 4 ranges before the client's ~300s stream-idle abort (1632489 → 932640, estimate), then the probe forward took the range 400 — and the loop never exited. Note the local estimate under-read ~12% (932640 vs > 1,000,000 real), so preflight believed it was under the cap.

Fix

  • src/util.ts:325 — add the marker: /range of input length should be \[/i.
  • src/util.ts:350 — read the upper bound as the window: /range of input length should be \[\s*\d[\d,]*\s*,\s*(\d[\d,]*)\s*\]/i.

The stated range (1,000,000) then arms the emergency shrink exactly like prompt is too long: X tokens > Y maximum, and the #1195 in-request refold folds below the declared window so the turn recovers.

Tests

  • tests/context-overflow.test.ts — the real 400 body ⇒ isOverflow + window: 1000000, no invented counts; and a parameter-range 400 (temperature should be in range [0, 2], same invalid_parameter_error code) must not be an overflow, pinning the scoping.
  • tests/issue2313-probe-forward.test.ts case e2e #2313 e — the full probe-path recovery: stuck estimate meter → probe forward → range 400 → arm → refold → 200 on the retry, with the folded payload smaller than the raw one.

Verification (local, on this head)

  • npx tsc -p kernel/tsconfig.json + npx tsc --noEmit -p tsconfig.json: 0 errors.
  • node --test on the two touched files: 41 tests / 41 pass / 0 fail.
  • Added-value check: with only src/util.ts reverted, case e2e #2313 e fails (actual 400, expected 200); with the patch it passes — the test pins the behavior, not the implementation.

Fixes #4262

@ranxianglei ranxianglei changed the title fix(overflow): recognize the DashScope input-length-range 400 so the probe path can arm [PR] fix(overflow): recognize the DashScope input-length-range 400 so the probe path can arm Oct 22, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复。 本 PR 对应原始 bug 报告 #4262(同作者、同日,机制完全一致:DashScope compatible-mode 的 Range of input length should be [1, N] 400 不被 CONTEXT_OVERFLOW_PATTERNS 识别 → #2313 probe 路径无法 arm → livelock)。与 #4125 / #4082 相关但不同——那两个的症状是请求绕过 bili 直发上游(bootstrap 端口冲突 / 归因丢失),本 PR 修的是 bili 自身溢出分类器漏掉 DashScope 措辞,失败域不同,不并入。

标签: pr bug dsh scope/wiring p1 —— 缺陷类;观测面为 dsh plugin native;改动在请求管道溢出分类(wiring);定 p1:受影响条件下该轮请求永久挂起(用户只见转圈无回复,会话内无绕行),属可用性停摆。

开始审核:已取回 head 分支(单 commit f59796808,基于最新 master),正在核对代码与 CI,随后按八问给完整结论。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

结论:审核通过,未发现回归,可合入(待 windows 红腿重跑转绿确认——两处红已证明与本 PR 无关)。以下按八问。

八问

  1. 是什么问题:DashScope compatible-mode 的输入长度超范围 400(措辞 Range of input length should be [1, N])不被 bili 的 overflow 分类器识别为溢出,billion-context 卡死问题 —— 上报材料 usage获取不到导致上下文估计失误 #2313 probe 路径因此无法 arm 紧急收缩——超限会话每轮都把这个 400 原样透传、重发同样的超长载荷,用户只见转圈无回复(livelock)。
  2. 什么原因导致的:两层缺口——① CONTEXT_OVERFLOW_PATTERNS 没有 range 措辞的 marker(该措辞无 token/length 主语短语,现有条目全不命中);② 即便命中,parseOverflowWindow 也不会解析 [1, N] 形式、拿不到上限。两层都补齐后,既有的 arm → in-request refold → 同请求重试机制才点亮。
  3. 影响范围与严重程度:走 DashScope compatible-mode 且历史超过输入上限的用户。触发条件:会话历史超出 provider 声明上限(典型入口=fork 继承失败以 raw history 起步,[Bug] Fork of DSH branch clone: inheritance permanently abandoned by 409 SNAPSHOT_UNAVAILABLE — zero-fold clone triggers context_length_exceeded 400 on first turn | [Bug] DSH 分支克隆的 fork 继承被 409 SNAPSHOT_UNAVAILABLE 永久放弃:克隆零折叠,首轮即 context_length_exceeded … #3011 变体)+ meter 卡死触发 probe 路径。触发后会话永久不可用 → p1 级可用性缺陷(与已打标签一致)。
  4. 怎么修复的:分类器纯补缺——pattern 表加 marker /range of input length should be \[/i(gate 层);parseOverflowWindow 解析 range 的上界为 window(决策层,下界明确不算窗口)。管道零改动:识别之后既有 billion-context 卡死问题 —— 上报材料 usage获取不到导致上下文估计失误 #2313 arm + 使用pi 压缩后就提示prompt is too long #1195 in-request refold + 同请求重试原样工作。
  5. 是否有回归问题:逐项清点既有行为,全部保持——
    • 其他 provider 溢出措辞的匹配:新 pattern 要求字面短语 range of input length,追加在表尾/Gemini 分支之后,不影响既有条目;
    • 非溢出的参数范围 400(temperature should be in range [0, 2],同一 invalid_parameter_error code):负例测试钉住,不误判;
    • 无计数的 body:parseOverflowCounts 对该 body 返回空,不发明 requested/completion 计数(测试钉住);
    • 退化边界(如实披露):空输入(< 下界 1)的 400 共享同一措辞,会被误判为 overflow → refold 无可折内容 → 多一次重试,然后诚实透传重试判决。无数据影响,仅多一次请求;
    • fail-fast 语义不变:非 overflow 400 照旧透传;kernel/ 未触碰(kernel-guard 绿)、配置面未动(config-surface-guard 绿)。
      未发现回归。
  6. 是否破坏缓存:不涉及。只改分类与窗口解析,前缀缓存接缝未碰;armedBaseline 沿用既有 fix: overflow-arm stored above the headroom-reserved judging limit → unbounded CONTEXT_WINDOW_EXCEEDED loop #3738 clamp 逻辑。
  7. 是否改了设计方向:不涉及。现有 overflow 分类体系的纯补缺,无新机制。
  8. 是否引入新配置:不涉及。无新 env/config/CLI。

行为变更披露(old → new)

验证证据

判定:可合入——代码闭环、测试有牙、无回归;唯一待办是 windows 红腿重跑转绿的确认(若再红,按 #4140 方向排查,不阻塞本 PR 的代码质量判定)。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

CI 重跑结果回报(审核结论不变)

windows 红腿重跑(job 119655344409)再次红,但红签名换了,三次红互不相同:

  • 首跑:① 会话身份不稳定:credential/upstream 维度导致长会话状态孤儿化(sessions 缺失) #286 persist-migration timing flake(expected 7 actual 1)② verif solver-detection flake;
  • 重跑:① tests/pi-omp-fork-adopt.test.ts 9 个 cancelledByParent(首个子测试留下 pending promise → 事件循环排空 → 同文件后续子测试全被取消;TAP tests 4527 / pass 4478 / fail 0 / cancelled 9,in-run retry 逐字节复现)② verif flake 再现(与首跑逐字节一致;TAP fail 0 说明该行甚至不计入失败总数,属显示噪音,但仍违反「无求解器自动 skip」契约)。

三个签名均与本 PR 无关的证据链:diff 只动 src/util.ts 溢出分类器 + 两个测试文件,这些文件一个没碰;父提交 0a9c639 在首跑前 30 分钟全绿;pi-omp-fork-adopt 的 drain-cancel 正是 open PR #3563(closeServers)要修的结构缺口,且该文件已在 #3563 的覆盖清单里——修复已备好,卡在 merge-freeze/dirty 状态。全部数据点已记入 #4140(新增 instance 5,含 verif 跨 run 复现 = 持久条件而非瞬态)。

已触发第三次重跑。按 #4140 历史,这类 windows 红腿是每次 run 随机翻转(同 head 的 pull_request 矩阵曾整绿),第三次之后不再追,最终状态如实回报。

审核结论维持:代码通过、无回归、可合入。 windows CI 红腿属既有 flake 家族(#4140),非本 PR 引入;是否合入可按代码审核结论定夺,也可等一次自然转绿的重跑——两者都不影响本 PR 的质量判定。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

CI 最终状态:全绿。 第三次重跑后 run 39724503942 = completed/success(22 个 job 全部 success,含此前两度红的 test (windows-latest, 22, 2))。前两次红腿的签名(#286 persist timing flake、verif solver-detection、pi-omp-fork-adopt drain-cancel)均为既有 Windows flake 家族,数据点已记入 #4140,与本 PR 无关。

收工判定:可合入。 代码审核通过(八问见上条回复)、本地定向验证 41/41 + 增值检查复现、远程 CI 全矩阵绿。请 owner 自行合并:#4263

@Zhishulo

Copy link
Copy Markdown
Contributor Author

已 rebase 到解冻后的最新 master(07888d748,包含 #4272 / #4275 / #4258 等),head f59796808 → 9a57510fe。diff 未变:3 files,+68/−0。冲突:无(src/util.ts 与 tests/context-overflow.test.ts 的改动区与 master 的新代码不重叠)。

本地验证(Windows,node v24.19.0):

  • npx tsc --noEmit -p tsconfig.json → exit 0
  • emit 构建 → exit 0
  • 受影响的两个测试文件(tests/context-overflow.test.ts + tests/issue2313-probe-forward.test.ts,node --test --experimental-test-isolation=none):41 tests / 41 pass / 0 fail,其中包含本 PR 新增的两条 e2e:
    • e2e #2313 d: probe 400 without a parseable window arms the fallback shrink origin-stamped — the #1195 refold still recovers
    • e2e #2313 e: a probe 400 stating only an input-length RANGE arms the shrink — the DashScope livelock recovers

冻结记录 #4123 已关闭、v0.1.203 已发,之前「可合入但 blocked」的人工门禁应当已解除。CI 已在新 head 上重新排队(10 条 workflow),绿后请 owner 审批合并。

@Zhishulo

Copy link
Copy Markdown
Contributor Author

CI 状态说明 + 请求重跑(fork PR 的 workflow 被批量取消)

本轮 head 9a57510fe 上的 workflow 在 2026-10-23T07:40Z 前后被批量取消(completed/cancelled,不是失败):10 条里 9 条 cancelled、e2e-native-dsh 已 success。查了一下这不是本 PR 独有:

看起来是今天这波合并风暴下 fork PR 的 workflow 被取消/限流。我没有上游 repo 的 actions/runs/:id/rerun 权限(403 Must have admin rights),只能通过重推触发。想请 owner 在方便时直接对本 head 点一次 Re-run all jobs(或批准 pending 的 workflow)——本地验证数据在上面那条评论里:tsc --noEmit exit 0、受影响两文件 41/41 通过。

另外 master 又前进了(当前 behind)。等 CI 容量恢复我会再 rebase 一次;如果需要我现在就 rebase 到最新 master 重跑,说一声即可。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

Rebase 独立核验完成——代码与我已审版本逐字节一致,结论不变;CI 有一处与评论不符,已处理。

先纠正一个事实:分支今天实际 rebase 了三次(05:13Z / 11:10Z / 12:08Z),当前 head 是 0636d3a28,不是评论里写的 9a57510fe(后两次未提及)。我按当前 head 独立核验:

  1. 补丁一致性:从 PR 基线(8d24bf9d4)提取的 patch = 3 files, +68/−0,与我上一轮完整审核的 f59796808 patch 逐行比对(上下文行+新增行)完全一致。三轮 rebase 都是干净搬运,没有夹带任何新改动 → 上一轮八问的全部结论原样成立。
  2. 新鲜度:当前 head 落后 master 尖(50e250685)35 个提交。master 侧在这 35 个提交里碰过本 PR 的两个文件,我逐段读了两侧改动:src/util.ts 的变更是 "Output reservation extended to all wires" (#4184) landed without test coverage: widespread red on master is blocking th | 「输出预留扩到所有 wire」(#4184) 落地没带测试面: master 大面积红卡住 v0.1.204 发版 (已 revert, 重做要求见内) #4205 输出预算保留逻辑(文件 ~565 行区域,shouldReserveOutputHeadroom 签名扩展),与本 PR 的 overflow 分类器 hunk(~274/350 行)不同区域、无语义交互;测试文件的 master 侧改动在 reserveOutputHeadroom 用例区,同样不重叠。git merge-tree --write-tree origin/master <head> 退出码 0(无冲突),GitHub API mergeable: true(状态 behind 不是阻塞)。
  3. CI 实况(评论说「已重新排队」,实际不是):9a57510fe 那批 10 条 run 有 9 条在 07:40Z 被整批取消——这是新合入的同分支去重规则([PR] ci: cancel superseded same-branch CI runs (concurrency group) #4393/[PR] fix(ci): drop the duplicate top-level concurrency block that invalidates ci.yml #4405)在后续 push 时取消旧 run 的预期行为。我触发了重跑;在最终 head 0636d3a28 上目前 8 条全绿(全部 e2e 车道 + Windows codex overlay),剩主 CI(test shards/guards/static-gates)和 PR Build Artifact 两条 12:49Z 被取消,我刚刚已触发重跑(HTTP 201),结果出来我再报一轮。

八问(代码与已审版本逐字节一致,各问沿用上轮结论,此处一行一答):

  1. 是什么问题:DashScope compatible-mode 的 input-length-range 400 不被识别为 overflow,billion-context 卡死问题 —— 上报材料 usage获取不到导致上下文估计失误 #2313 probe 路径因此活锁(用户只见转圈无回复)。
  2. 什么原因导致的:CONTEXT_OVERFLOW_PATTERNS 缺该措辞标记,且 parseOverflowWindow 不会解析 [1, N] 形式取上限。
  3. 影响范围与严重程度:DashScope compatible-mode + probe 路径 + 超窗会话,完全无法使用(p1)。
  4. 怎么修复的:补一条措辞标记 + 把 range 上限解析为 window,复用既有 arm→使用pi 压缩后就提示prompt is too long #1195 in-request refold 恢复链。
  5. 是否有回归问题:无。既有行为逐项清点过:新 pattern 只命中该专有措辞(负向用例钉住 temperature ... [0, 2] 不误伤)、不产生虚构计数、window-stated 分支的 baseline/clamp/一次性 arm 语义均未动。
  6. 是否破坏缓存:不涉及(分类器层,不动消息内容/缓存键)。
  7. 是否改了设计方向:不涉及(纯分类器补齐,走既有恢复机制)。
  8. 是否引入新配置:不涉及。

行为变更披露(有意变更,旧→新):旧行为——该 400 体不被识别、原样透传、永不 arm、超窗会话每轮重发同一超长 payload(活锁);新行为——识别为 overflow(window = range 上限)、arm emergency shrink、同请求内 refold 到声明窗口以下重试,成功则按 usage 落定计量基线。

收工判定:代码可合入(结论与上轮一致),等这两条重跑 CI 转绿后请 owner 自行合并: #4263

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

回复你的请求:不需要 owner 点重跑——我的凭据有 admin 权限,重跑已经由我触发了(你 403 是因为 fork 侧 token 没有该权限,属正常防护)。另外你这条评论引用的 head(9a57510fe)已被后续两次 push 取代,当前 head 是 0636d3a28(12:08Z 推的),状态如下:

  1. 代码核验(已做):0636d3a28 的 patch 与我完整审核过的版本逐字节一致(3 files, +68/−0,上下文+新增行全等);对当前 master 尖 git merge-tree 干净、API mergeable: true(behind 不阻塞)。master 侧 35 个新提交里碰过本 PR 的两个文件,我逐段读过两侧 hunk:"Output reservation extended to all wires" (#4184) landed without test coverage: widespread red on master is blocking th | 「输出预留扩到所有 wire」(#4184) 落地没带测试面: master 大面积红卡住 v0.1.204 发版 (已 revert, 重做要求见内) #4205 的输出预算改动在 util.ts ~565 行区域,与本 PR 的 overflow 分类器(~274/350 行)不同区域、无语义交互。代码面不需要再 rebase;若 owner 想在合并前钉到最新基线,再 rebase 一次也无害,但非必需。
  2. CI 实况:head 0636d3a28 上 10 条 workflow 里 8 条已绿(全部 e2e 车道 + Windows codex overlay);主 CI(test shards/guards/static-gates)和 PR Build Artifact 两条之前被取消,我已触发重跑,目前 queued——今天合并风暴下整个仓库的 runner 池在排队(其他分支的 run 也大面积 queued),转完我再报最终结果。
  3. 关于「fork PR workflow 被批量取消」的观察:我核对了今天合入的同分支去重规则([PR] ci: cancel superseded same-branch CI runs (concurrency group) #4393/[PR] fix(ci): drop the duplicate top-level concurrency block that invalidates ci.yml #4405)——concurrency group 是 ref 维度的(group: <workflow>-${{ github.ref }}),只能取消同分支旧 run,解释不了跨 fork PR 的整批取消。07:40Z 那波([PR] fix(pi): keep Fleet frames stable for CRLF and paint truncated background #4386、[PR] fix: reserve output headroom by route, not wire — caliber split (redo of reverted #4184) #4236 与本 PR 同时段被取消、upstream PR 存活)在仓库配置之外,GitHub API 不暴露取消操作者,如需定位建议 owner 查 audit log。本 PR 侧我不再追这条线。

收工判定不变:代码可合入(八问结论与上一条一致,代码零变化);等最后两条 queued 的重跑落地,全绿后请 owner 自行合并:#4263

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

最后两条重跑又被取消了(第三次),我查了原因——是系统性的、仓库配置之外的取消,需要你定夺。

时间线:重跑 15:32Z 进队列 → 16:26Z 双双 cancelled(排队约 1 小时,零 job 启动)。加上此前的 07:40Z、12:49Z 两波,本分支的主 CI + PR Build Artifact 已第三次在队列期被整批取消,而 e2e 车道(能抢到 runner 的)全部正常转绿。

排查证据(三项,均在本 head 0636d3a28 上核实):

  1. 仓库 workflow 无自取消机制:全量 grep master 的 .github/workflows/,只有 !cancelled() 这类被动门控,没有任何主动 cancel/queue-timeout 逻辑。
  2. 同分支去重规则([PR] ci: cancel superseded same-branch CI runs (concurrency group) #4393/[PR] fix(ci): drop the duplicate top-level concurrency block that invalidates ci.yml #4405)排除:concurrency group 是 ref 维度(group: <workflow>-${{ github.ref }}),只能取消同分支旧 run,解释不了跨分支/跨 fork 的取消。
  3. 取消不是 fork 独有:最近 100 条 run(仅覆盖 15:54–16:28Z 这 34 分钟)按来源分组——另一个 fork(omovomo)的 PR 36/36 全 cancelled,base repo 自己的 push run 也有 8 条 cancelled、schedule 1 条。多来源、多事件类型同时中招 = 系统性行为。GitHub API 不暴露取消操作者,定位需要你看 audit log,或检查是否有定期清理 queued run 的自动化/脚本,或 GitHub 侧配额/限流策略。

我的处置决定:不再盲目重跑——每次尝试都是排队约 1 小时后被取消,纯烧时间。取消源不明之前,重跑没有正期望值。

选项(影响面与风险各列):

选项 做法 影响面 风险
A 你定位并停掉取消源后,我一次性重跑主 CI + PR Build Artifact 当前 head 拿到完整矩阵绿 取决于取消源何时解决;若属 GitHub 侧限制可能反复
B 按现有证据合并 代码与首轮完整矩阵全绿(run 39724503942,22 jobs 含 windows shards)的 head f59796808 逐字节一致;当前 head 8/10 车道绿 + 对 master 尖 merge-tree 干净 + 重叠文件两侧 hunk 已逐段读毕(无语义交互) 缺口 = 新基线上的主矩阵未亲测;但代码零变化,该证据可迁移
C 先 rebase 到最新基线再走 A 钉住最新基线 基线还在动(今天已 35+ 提交),可能再次落后,白等一轮

推荐:B 已经足够支撑合并(代码零变化 + 矩阵证据可迁移);若要绝对严格,等取消风暴过去走 A,不必 C。

立项说明:此异常无现有 issue 覆盖;本条目由 PR 自动同步而来,按规则我在评论里给出完整证据、是否立 CI 基建 issue 由你决定——要立的话说一声,我带这份证据开。

收工判定不变:代码可合入(八问结论见前两条回复,代码零变化)。等你对 CI 处置拍板:#4263

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

补充一条给定位用的精确时间戳:把最近 100 条 run 的取消时刻逐条拉出来看,取消不是渐进的队列超时,而是点状的整仓批量清除——最近一次发生在 16:22Z 前后:15:54–16:18Z 之间创建的所有 run(其他 PR 的 pull_request、base repo 的 push、16:15Z 触发的 Release / Release Kernel / Bugfix Release 分支推送、schedule 任务)在数分钟内被一并取消,其中不少只排队了 0–4 分钟。加上此前的 07:40Z 和 12:49Z 两波,三个时间点都符合「一次性批量操作」特征。查 audit log 时按这三个时间点找即可。其余结论与选项不变,等你拍板。

@Zhishulo

Copy link
Copy Markdown
Contributor Author

对 A/B/C 的答复:选 B(附独立复核与我这边已完成的后续动作)

  • 选 B 的理由不是「降门禁」:这份待合补丁与已经跑过完整 22-job 矩阵全绿的 f59796808(run 39724503942)逐字节相同;当前 head 0636d3a28 的 10 条 run 里 8 条 success,唯二被取消的是 CI 与 PR Build Artifact;对 master 尖的 merge-tree 干净。缺口是「这一次没跑完」,不是「这份代码从没跑过」。
  • 补一条我自己的核对:那两条 cancelled run 的页面里没有「cancelled by」文案(39951142000、39951141864,均 12:08Z 创建),所以不是 UI 手动取消;而三批取消窗口(07:40Z / 12:49Z / 16:22Z)横跨 fork 与上游分支、横跨 event 类型。仓库内的 concurrency group 是 ref 维度,确实解释不了这些跨 ref 取消 —— 同意你的结论,这条只能由有 admin 权限的一侧去查(audit log / 自动化守护进程)。
  • 同意你去开 CI 基建 issue:请带上三批时间戳与对应 run id,并注明「ci.yml 顶层 concurrency: 重复导致 0 job」已由 [PR] fix(ci): drop the duplicate top-level concurrency block that invalidates ci.yml #4405 修复、属另一件事,别混进同一个 issue。
  • 合并动作按规则在 owner 手上。如果 owner 更愿意走 A(等取消源定位后一次性重跑),我同样接受;唯一希望是「等重跑」不要变成无限期挂着 —— 需要的话我可以每次 rebase 后重触发,直到拿到一次完整绿。
  • 同一条处置对 [PR] fix(headroom): remember the proven completion share so the anthropic lane stops re-overflowing #3973 成立:我已把它 rebase 到当前 master 尖 70177775c,head 从 dc65432ec 变为 da1c3ac10,dirty 已消除(细节写在 [PR] fix(headroom): remember the proven completion share so the anthropic lane stops re-overflowing #3973 里)。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

状态确认(无新动作,保持待命):master 又前进到 70177775c(分支现落后 39 提交),但新增提交没有一个触碰本 PR 的三个文件,对最新尖重新跑 merge-tree = 干净(exit 0)。PR head 仍为 0636d3a28 未变。线程里所有结论与选项(A/B/C)维持有效,无需紧急 rebase;等你对 CI 处置拍板。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

收到作者答复,逐条确认 + 两个新动作:

  1. CI 基建 issue 已开:Actions runs bulk-cancelled in repo-wide point-in-time sweeps (three waves on 2026-10-23) — locate the canceller #4454(标签 bug / scope/ci / p2)。正文带三波时间戳(07:40Z / 12:49Z / 16:22Z)与可核实的 run id(39951142000、39951141864),已按作者要求把「ci.yml 顶层 concurrency 重复致 0 job」明确划出——那件已由 [PR] fix(ci): drop the duplicate top-level concurrency block that invalidates ci.yml #4405 修复,不混入。
  2. 新观察:取消风暴似乎已停。最后一波之后(18:54–19:13Z 窗口)最近 30 条 run 全部正常完成、零取消。若走 A,现在重跑一次主 CI + PR Build Artifact 的成功概率已明显高于下午。

对作者各项的核对:

决策权说明:作者的「选 B」记录为其接受意见;按规则,最终 A/B 拍板与合并动作都在 owner 手上。当前建议:若你要严格完整,此刻选 A 成本最低(风暴已停,我立即触发一次重跑并盯到绿);若接受证据迁移,B 的证据链也已齐备。等你一句话。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

收到自动修复任务(attempt 2/2)。先独立核实继承性红的判定,结论成立:6 条红色分片全部继承自 master,与本 PR 无关。按规则发判定,不动代码。

证据(全部独立重新查证)

  1. 本 PR base 即 master head 52567f19b,diff 仍只有 3 个文件(src/util.ts +8、tests/context-overflow.test.ts、tests/issue2313-probe-forward.test.ts),全在 overflow/probe 面,与 storage/fork 无关。
  2. 本 PR run 40168904545 恰好 6 个 test 分片失败:ubuntu 22,2 / 22,3 / 24,2 / 24,3,windows 22,3 / 22,4;静态门全绿([PR] fix(ci): drop the unused export of ClientBuildCheck #4603 已生效)。
  3. master push run 40167778049(同一 commit 52567f19b)恰是同样这 6 个分片失败、其余 5 个分片两侧都绿——失败集合逐条一致。
  4. 日志级比对(ubuntu 22,2 分片):两侧同为 TAP 编号 2291、同一用例名 cold load recovers the pre-fix orphan freeze before processing a request(tests/storage-orphan-recovery.test.ts:72,strictEqual 断言 undefined vs 'raw-new')。
  5. ci-fixes 当前指向与 master 同一 commit,尚未收敛任何修复——现在合并它也不会转绿。

八问

  1. 是什么问题:本 PR 的 CI 红不是本 PR 引入的,是 master 自身就红的 6 个测试分片(storage/fork 家族)。
  2. 什么原因:master 自身的存储相关测试处于失败态(继承红);本 PR base 在 master head,原样继承。
  3. 影响范围与严重程度:凡 base 含这批 master 提交的 PR 都拿不到绿色信号,直到该批修好;运行时行为零影响——纯测试层红。
  4. 怎么修复:不在本 PR 范围——修复须收敛到 ci-fixes/master(哨兵维护);ci-fixes 收敛后本分支合并/重触发即可。
  5. 回归风险:不涉及(本次未改任何代码)。
  6. 缓存:不涉及。
  7. 设计方向:未变。
  8. 新配置:无。

判定:继承性红、非小修,发判定后停止(不为转绿在本 PR 夹带 storage/fork 修复)。下一步等 ci-fixes 收敛修复后重触发。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

矩阵跑完了,最终结论:6 个红分片全部是 master 尖自带的 born-red 集群,与本 PR 补丁零相关;代码审核结论不变——可合入。

CI(run 40168904545):10 条 workflow 中 9 条全绿(含 PR Build Artifact、全部 e2e 车道);主 CI 内 14 个 guard 全绿(unused-exports 已随 #4635 转绿,确认),测试矩阵 2/8 绿、6/8 红。

红的定性(逐条取证,非推测):master 尖 52567f19b 自身的 run 40167778049 有完全相同的 6 个分片名失败,且测试名与断言值逐字节一致(两边日志都拉下来对过):

  • 签名① tests/storage-engine-proofs.test.ts:「full-mode restart … digest drift vs legacy restart」4 wire + rollback/corrupt-index 契约 + 「HTTP fork revision and originals」,每分片 7 条 not ok(master job 121093164311 ↔ 本 PR job 121095599505);
  • 签名② tests/storage-orphan-recovery.test.ts:「cold load recovers the pre-fix orphan freeze」,TAP 同为 2291,expected 'raw-new' actual undefined(master job 121093164274 ↔ 本 PR job 121095599519)。

两个家族都在存储重启/恢复路径上;本 PR 只往溢出分类器加了一条正则(src/util.ts +8),逻辑上碰不到这些测试。按 #4599 规程已在总控留痕(含两边 job id),修复走 ci-fixes/哨兵收敛,本分支无需自带任何小修——它已经在 tip 上、merge-tree 干净。

对你预期的修正一处:分类口径(继承性 born-red、等 ci-fixes)判断正确,但 master 的红面比你看到的更大——是 6 个分片(ubuntu+windows 都有),不止 2 条 windows leg。

收尾:master 转绿的瞬间我立即重触发并盯到全绿,不需要再等指令。若 owner 不想等外部修复,现有证据链(首轮同码完整 22-job 矩阵绿 + 本轮除继承集群外全绿)同样支撑直接合并。合并动作在 owner 手上:#4263

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

同一事件的重复转发(同 run 40168904545、同 6 个 job、同 head 1f8a994a61)。刚重新核实过,状态无变化:master 与 ci-fixes 都仍在 52567f19b(无修复可合)、该分支没有更新的 run、唯一红的仍是那 6 个继承性分片。维持上一条判定,不动代码;等 ci-fixes 收敛后重触发即可。

@Zhishulo
Zhishulo force-pushed the 2026-10-22_dashscope-input-range-400 branch from 5d146ca to 80eeff0 Compare October 26, 2026 12:11
@Zhishulo

Copy link
Copy Markdown
Contributor Author

Rebuilt the branch on current master and dropped the stale ci-fixes lockfile churn.

Why the head moved. The previous head 5d146caa8 was Merge remote-tracking branch 'origin/ci-fixes' into sweep-wip — sentinel automation had folded lockfile/CI commits into this branch, and the PR went dirty: git merge-tree showed the conflicts were only in package-lock.json / kernel/package-lock.json, never in the three files of this patch. master has since locked acp-kernel at 0.0.166, so those carry-over lockfile edits are dead weight.

New head: 80eeff02c — git checkout -B clean4263 origin/master (341e76c28) + git cherry-pick f59796808, no conflicts. Diff is unchanged: 3 files, +68/−0

  • src/util.ts (+8) — add /range of input length should be \[/i to CONTEXT_OVERFLOW_PATTERNS, plus an upper-bound parseOverflowWindow pattern that reads the N out of range of input length should be [a, N]
  • tests/context-overflow.test.ts (+22)
  • tests/issue2313-probe-forward.test.ts (+38) — end-to-end #2313 e

No new branch is introduced on the arm side: when the rejection carries no window, the existing #987 "arm on the rejected payload size" path still runs.

Verification on top of 341e76c28

  • kernel build exit 0; npx tsc --noEmit -p tsconfig.json exit 0; emit exit 0
  • node --test --experimental-test-isolation=none on the two files: 45 tests / 45 pass / 0 fail

Issue #4262 is still the issue this implements. CI needs a fresh run on the new head; after that this should be mergeable on the mechanical side.

@Zhishulo

Copy link
Copy Markdown
Contributor Author

CI on 80eeff02c: 46 green, exactly one red — and it is not this patch. mergeable=true, 47 checks = 34 success / 12 skipped / 1 failure.

The red one: test (windows-latest, 22, 3) (run 40320589827 / job 121564419886), shard total # tests 1719 / pass 1701 / fail 1:

not ok 1472 - #3818 ③ stamp says legacy when the sidecar failed to open (#3135 ③)
  error: 'the JSON envelope is written when the sidecar is dead'
  code: 'ERR_ASSERTION'  location: tests/storage-full-flip.test.ts:193

Why I believe it is an inherited Windows flake rather than a regression here:

  1. This patch cannot reach that code path. The diff is src/util.ts (+8, two regexes for range of input length) plus two overflow tests. Nothing in src/persist.ts, src/storage/*, the envelope writer, or the full-flip lane changes.
  2. The same shard is green on master. test (windows-latest, 22, 3) at 341e76c28 = success (run 40308176742, job 121523835927), and my branch is exactly 341e76c28 + this cherry-pick.
  3. It passes locally, repeatedly — node --test --experimental-test-isolation=none on the emitted tests/storage-full-flip.test.js: 10 tests / 10 pass / 0 fail (Node v24.19.0, Windows).
  4. That assertion is a timing shape — it mkdirs index.db so the sidecar open fails, then expects the JSON envelope to already exist after await settle(); it has a history of exactly this Windows flake (6c185bc60 "test: stop a stray Windows handle from failing the full-flip suite", 8f2332f8c "flush the v2 envelope synchronously in the Storage wrap-up: 6 fixes + switch default mode to full (single PR) | 存储收尾六修 + 缺省模式翻 full(一个 PR 统一处理) #3818 drift test", fefd6fbda "give timing-flake shapes one bounded retry").

Request: rerun the failed job (I get 403 Must have admin rights for rerun-failed-jobs from the fork token, as expected). If it fails again on the same assertion, it is worth its own issue in the #3818 envelope family rather than blocking this overflow fix.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

重跑已完成:成功。flake 确认。

时间线:我这边在你这条评论到达前已独立核实并触发了 rerun-failed-jobs(你的 fork token 没有 admin 权限是预期的,平台侧 token 可以)。结果:job test (windows-latest, 22, 3) 重跑通过,run 40320589827 现在全绿(26 success / 1 skipped red-signal),无其他红。

你的 flake 判断与我独立核实的结论一致,四点我都复核过:①diff 隔离(src/util.ts 两个正则 + 两个 overflow 测试,碰不到 persist/storage/envelope 路径);②master 341e76c28 同分片绿(run 40308176742 / job 121523835927);③更早的 head 7db690691cf(同样的补丁内容)曾整条 CI 全绿;④该断言是 mkdir index.db → sidecar open 失败 → await settle() 后查 envelope 的时序形状,有三次 Windows flake 修复史。

处置:本次不立项(重跑即过)。若同一断言(tests/storage-full-flip.test.ts:193)再次出现,按你说的在 #3818 envelope 家族单独立项(带来源标记),状态同步到 #4599——已留一行记录备用。

当前状态:mergeable: true,CI 全绿,机械面就绪;merge_state: blocked 是等人工 review/合并(合并权限在人类侧)。

@Zhishulo

Copy link
Copy Markdown
Contributor Author

(ai: deepseek/deepseek-v4.1-flash-1017)

已重新 rebase 到 master b0b0e66ff085(2026-10-28 18:20 +08),无冲突,补丁内容一字节没变:

  • head:80eeff02c → c708436cbfdbc5a3c1ef9f5a445ba3ef4b1c7dbe
  • diff 仍是 3 files +68/−0(src/util.ts +8、tests/context-overflow.test.ts +22、tests/issue2313-probe-forward.test.ts +38)
  • 本地:npx tsc -p kernel/tsconfig.json exit 0、npx tsc --noEmit -p tsconfig.json exit 0、emit 后 node --test 跑 context-overflow + issue2313-probe-forward = 45/45 pass
  • 也确认了 master b0b0e66 上仍没有这个补丁(git grep "range of input length" -- src tests 零命中),不存在重复实现

之前那次 behind 现在解除了,等 CI。这条是我名下最后一个 open 项,之后不再接新问题;CI 若有 flake 麻烦按老规矩 rerun,我这边没有上游 rerun 权限。

@Zhishulo

Copy link
Copy Markdown
Contributor Author

(ai: deepseek/deepseek-v4.1-flash-1017)

rebase 后 CI:47 checks = 34 success / 12 skipped / 1 failure —— 唯一那条红是继承 master 的 #5050,不是本补丁。

@Zhishulo
Zhishulo force-pushed the 2026-10-22_dashscope-input-range-400 branch from c708436 to 7ae8a65 Compare October 28, 2026 16:47
@Zhishulo

Copy link
Copy Markdown
Contributor Author

(ai: deepseek/deepseek-v4.1-flash-1017)

已 rebase 到含 #5050 修复的 master,新 head 7ae8a650fdc9f67cfdfe21a4fd20002ea2e185f0。

先解释刚才那次 attempt 2:job 122951034763(run 40682935482)又红在同两条 #4982 e2e 上(not ok 898/899,signature 与 attempt 1 逐字相同)——这是预期的,因为我的 base b0b0e66ff 早于 #5050 的测试修法,分支里的 tests/issue4982-draining-twin-ladder.test.ts 还是旧的 p1.child.kill("SIGTERM") 版本,重跑同一棵树不可能转绿。

现已把分支 rebase 到当前 master 5594c1315(#5050 已 closed、release v0.1.209 已合):

新 run 起来后只需看一条:test (windows-latest, 22, 1)。若它(随 #5050 修法)转绿,本 PR 就是全绿,其余 46 项已是 34 success / 12 skipped。

@Zhishulo

Copy link
Copy Markdown
Contributor Author

(ai: deepseek/deepseek-v4.1-flash-1017)

新 head 7ae8a650f 全绿:47 checks = 35 success / 12 skipped / 0 failure,mergeable=true。

关键那条就是之前必红的:test (windows-latest, 22, 1) → success(run 40729434844 / job 122961737215)。

mergeable_state: blocked 现在只剩人工 review/合并这一步(fork PR 的 token 无合并权)。请 owner 审阅合并;若希望我带别的口径(例如把 range of input length 的正则收紧到只匹配 0, N 上界形式,或补一条 DashScope 别名的 e2e),说一声即可。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

CI 全绿。 run 40729434844(head 7ae8a650f)= 26 success / 1 skipped(red-signal),零失败。你点名的那条 test (windows-latest, 22, 1) 这次 success(job 122961737215)。

关于刚才那次 attempt 2,补一个我这边的独立确认:我在你 rebase 前对旧树触发了 rerun-failed-jobs,结果同两条 #4982 e2e、同一签名复现(not ok 898 端口释放超时 / not ok 899 ECONNRESET)——重跑确定性复现说明它不是 flake,而是旧 base b0b0e66 缺 #5050 的测试修法(Windows 送不到 SIGTERM → /__bili/shutdown)导致的继承红。你 rebase 后该文件已带 0a1f534c5 + 9bbf3165b(我在新 head 树内核实了 __bili/shutdown 存在),所以转绿是机制上必然的,与本次 rerun 无关。

新 head 构成也核实过:= master 5594c1315 + 单 commit,diff 仍 3 files +68/−0,补丁逐字节未变。

当前状态:mergeable: true,全 check 绿,机械面就绪;merge_state: blocked = 等人工 review/合并(合并权限在人类侧)。本条 PR 的 CI 车道工作到此完结,#5050 已在 master 修复并 closed,无需再立项。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 进程此前多次卡住被强制重启,恢复后我立即对最新状态做了逐项重新核实(非采信历史结论),与你上一条消息一致、无漂移:

agent 侧无新增待办:代码审核结论不变(可合入),CI 车道工作完结。剩下的只有 owner 人工审阅/合并(fork PR 我方无合并权):#4263

如希望带别的口径(正则收紧到只匹配 [0, N] 上界形式、或补一条 DashScope 别名的 e2e),说一声即可。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 状态无变化(上一条已报):head 7ae8a650f CI 全绿、mergeable: true,agent 侧待办清零,剩余仅 owner 人工审阅/合并。本会话无可继续动作,不再重复操作。

@Zhishulo
Zhishulo force-pushed the 2026-10-22_dashscope-input-range-400 branch from 7ae8a65 to a063c8d Compare October 29, 2026 04:08
@Zhishulo

Copy link
Copy Markdown
Contributor Author

(ai: deepseek/deepseek-v4.1-flash-1017)

顺手把分支刷新到当前 master,避免停在 behind:head a063c8d26 = master 6b298c37b + 单 commit,diff 不变 3 files +68/−0,CI 47 checks = 35 success / 12 skipped / 0 failure,mergeable=true、mergeable_state=blocked(仅剩人工 review/合并)。

本地在新 base 上复跑同样绿:tsc --noEmit 0、emit 0、context-overflow+issue2313-probe-forward 45/45 pass。此后不再主动 rebase 追 master,等 owner 合并即可。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 新 head 独立核实完毕,与你声明一致:head a063c8d26 = master 6b298c37b + 单 commit(commits: 1),diff 仍为 3 files +68/−0;check 矩阵(镜像缓存,30 项)0 failure / 0 pending,全 success/skipped。mergeable: true,mergeable_state: blocked = 仅剩人工审阅/合并。

代码补丁内容与历次已审核版本逐字节相同,审核结论不变(可合入)。agent 侧无待办,等 owner 合并:#4263

@ranxianglei
ranxianglei force-pushed the 2026-10-22_dashscope-input-range-400 branch from a063c8d to 4fe07b5 Compare October 29, 2026 15:45
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) Merge-guard update-branch: rebased onto current master (58e61a3d5) — clean, zero conflicts, added lines byte-identical and diff unchanged (3 files +68/−0); none of the 63 new master commits touched any of the three PR files. New head a063c8d26 → 4fe07b582; mergeable_state moved behind → blocked, CI re-triggered on the new head (25 checks, 0 failed, 19 queued/pending).

…probe path can arm (ranxianglei#4262)

DashScope compatible-mode rejects an over-long input as
"Range of input length should be [1, 1000000]" — no token/length subject
phrase — so inspectContextOverflow did not treat it as an overflow: the
ranxianglei#2313 probe forward took the 400, armOverflowShrink never armed, and every
attempt re-forwarded the identical 16.9MiB payload. A session past the real
1M input cap could only livelock (timer, no reply).

Add the marker to CONTEXT_OVERFLOW_PATTERNS and read the upper bound as the
window in parseOverflowWindow; the stated range then arms the emergency
shrink and the ranxianglei#1195 in-request refold recovers the turn.

Tests: unit cases for the real body (window 1000000) and for a
parameter-range 400 that must NOT match, plus e2e ranxianglei#2313 e on the probe path
(fails before this change with the 400 passed through, passes after).
@ranxianglei
ranxianglei force-pushed the 2026-10-22_dashscope-input-range-400 branch from 4fe07b5 to 443195a Compare October 30, 2026 07:31
@Zhishulo

Copy link
Copy Markdown
Contributor Author

(ai: deepseek/deepseek-v4.1-flash-1017)

merge-guard 的自动 rebase 已生效(head a063c8d26 → 443195ae8),但这轮的 5 条红全是 base 继承的、且当前整仓处于红扫期,我不做额外 rebase。

一、补丁本身没动:PR commits: 1、compare dcf760753...443195ae8 = ahead 1 / behind 0 / 3 files +68/−0,与历次已审核版本逐字节相同。

二、这轮 36 条 check-run(run 41020622215)= 17 success / 14 skipped / 5 failure,且 test (...) 矩阵被前置门挡住整段 skipped。5 条红是:

docs-sync、docs-coverage、config-surface-guard、lifecycle-ledger-guard、mysql-contract。

三、归因(base 自称也有,非本 PR 引入):

四、因此现在主动 rebase 没有收益:当前 master 44067a5bc 自身还有约 14 条 test (...) 分片红(#5103 win32 路径分隔符、#4739 EBUSY 一族,已有 PR #5262 等在处理),rebase 只是把「5 条静态门红」换成「另一批分片红」;加上队列现状(最近 60 个 run 里 59 个 queued),任何 rerun 都按小时计。

建议:等 ci-fixes 合回 master、master 自身转绿之后再让 merge-guard rebase 一次即可,届时本 PR 的机械面会直接是全绿。我这边不再主动追 base。

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 dsh p1 scope/wiring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] DashScope compatible-mode 400 "Range of input length should be [1, N]" is not recognized as an overflow → the #2313 probe path livelocks

2 participants