Repository navigation
[PR] plugin chat lane: make the degenerate retry terminal reachable + compat.degenerateTurn escape hatch (#4913) - #6993
ranxianglei wants to merge 9 commits into
Conversation
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]).
…ean (#4913) Two mechanical bugs behind the 36% retry->hard-fail rate in #4913: 1. The #2756 bare-turn exemption sat BELOW the fatal 'degenerated again' branch, so a retry the model left genuinely bare (no thinking, no echo, no released markup) could never pass through — the fatal branch always won. The bare gate now runs FIRST: a truly bare second attempt is passed through as a normal completion (its log line names the situation and the counters); only a retry that shows a qualifying signal dies. 2. The qualifying counters (sawThinking / sawStrippedEcho / releasedMarkupChars / visibleTextChars / answerProse) accumulated ACROSS the retry re-issue, so the first attempt's content qualified the second. They are now reset when the retry takes over; stream-level accumulators (proseAcc, diag*, blocksForwarded, seenToolCalls) keep their scope. The fatal log now carries the qualifying signals + finish reason so a hard failure is diagnosable from the log alone.
… terminal (#4913) New knob compat.degenerateTurn: "error" (default, #870 in-band stream error when the degenerate-turn retry ALSO ends empty) or "passthrough" (pre-#870: the empty turn passes through as a normal completion — the same terminal the proxy lane and the responses wire already take). Env twin BILI_DEGENERATE_TURN wins over the file; unknown values fall back to "error", so existing deployments are byte-for-byte unchanged. Config surface (AGENTS.md §3): added compat.degenerateTurn because the existing surface had no exit from the fatal terminal at all — the proxy lane (src/loop/core.ts falls through to plain completion) and the responses wire already pass this condition through silently, making the chat-pipe fatal branch the outlier. Rejected: a new top-level section (one knob does not justify one; AGENTS.md §3.2), and plugin.* (its only current member snapshotCapBytes is public fork-API config — the name/substance mismatch that got #1437 rejected as #1469). Sibling of compat.streamErrorShape by design (same env>file>default wiring, same permissive parse style, and streamErrorShape already shapes the error this knob can emit). No migration: default preserves current behavior.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10564-pr.6993.a369c20This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6993.tgz
npm install -g packageInstall instructions are refreshed on each push. |
|
(ai: vllm-qwen/qwen3.8-27b) Review passed. I re-derived the gate ladder shape-by-shape against the diff, ran the targeted suites locally, and did three small fixes directly (listed below). Regression audit — existing behaviors on the touched paths, item by item:
Small fixes applied directly (no decision needed):
八问
Verdict: mergeable — CI green on the synced head (08c237c) + owner merge. My earlier observability PR #4918 is superseded by commit df673be (the fatal log now carries the qualifying signals there) — I have left a note on it recommending closure. |
…l log (#4913) The PR body promises the fatal log carries the qualifying signals + finish reason, but both terminal log lines (the #870 fatal and the new compat.degenerateTurn=passthrough branch) named the signals without the finish reason. That also drops the finishReason field the superseded observability PR #4918 carried. Add finishReason=${reason} to both lines. Log-only; no behavior change.
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 本 issue 是 0.1.215 dsh lane 的综合报告(三症状),相关 drift / tag-leak 条目我已逐一关联(见下);但你 10:45 的 passthrough 判别实验是新的、决定性的归因数据,把"用户可见停"和"日志层 abort"分开了,不与既有条目重复,值得单独处理。 先确认你的判别实验(这组对照把归因钉死了):
问题 1 ── storage.unified=full 是不是默认/灰度?开关在哪?
问题 2 ── A 和 C 同根吗?
问题 3 ── 标签泄漏(现象 B)是不是 0.1.215 dsh lane 的已知回归?
现象 C 的相关条目(存储层 drift 族):
结论与下一步:
你继续 passthrough 观察是安全姿态(压缩路径旁路,不会更糟)。等 0.1.216 时把上面两个 PR 的合入状态带上看一眼即可。 |
(ai: vllm-qwen/qwen3.8-27b) CI-engineer handoff complete — the I was handed off the Verified on the PR head — ran Red items & conflicts — none. Mirror cache on head Current CI (mirror snapshot 02:51Z, ~16 min old and not yet refreshed): static gates all green (static-gates ×2, mysql-contract, pi-subagents-guard, docs-sync, kernel-guard); 11 Verdict: the CI red items and conflicts I was handed off are cleared. The PR is in a mergeable state pending the in-progress 八问
|
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。本 PR 与仍 open 的 #4918 同属 #4913,但 #6993 是 #4918 的超集——#4918 只做「fatal log 命名 qualifying signals + finishReason」(observability-only,不动行为);#6993 的 commit 1 已包含同样的 log 命名,加上 gate 顺序修复 + per-attempt 计数器 reset + 标签: bug / pi / dsh / scope/wiring / p2(缺陷:plugin 聊天车道退化重试终局不可达 + 无逃生开关;repro 在 pi 车道、代码注释点名 DSH 受影响;属客户端接入层接线;能用但有明显可靠性问题且有绕行开关 → p2)。 审核结论(按 PR Review 优先级)① 原 issue 方向: #4913 报告本地模型部署 36% 重试→硬失败。三诉求:(1) #2756 bare 豁免写在 fatal 分支之下 → 真正 bare 的重试永远过不去(终局不可达);(2) qualifying 计数器跨重试累积 → attempt 1 的 thinking 让 attempt 2 也判「又退化」;(3) 无配置逃生口。方向正确,打到了根因(终局不可达 + 计数器污染 + 无开关)。 ② 回归审查(逐项既有行为):
③ 代码审查: 逻辑正确。gate 顺序(bare 先于 fatal)+ per-attempt reset + 开关 wiring 都对。一处文档-代码不符已顺手修(见下)。 ④ 测试有效性: 真测试,断言有牙。 ⑤ diff 整洁度: 干净。9 文件 +302/-20,每行都与本 PR 目的相关(机械修复 + 开关 + 文档 + 测试)。无跑题文件、无锁文件 churn、无纯空行重排。 ⑤b 代码整洁: 命名达意(degenerateTurn/passthrough)、无死代码、错误处理完整(fatal log 带 qualifying signals)、风格一致、未引入新依赖。 顺手修(已 push 到 PR 分支)commit 7b6aa99 — 待 owner 处理(我不关)
结构化八问
判定: 可合。机械修复 + 开关方向正确、测试有牙、diff 干净;已顺手修掉 finishReason 缺失(commit 7b6aa99)。合入前需:owner 关闭被取代的 #4918;architecture-docs 继承红按 CI 协调政策在 #4599 收敛(非本 PR 阻塞项)。 |
(ai: vllm-qwen/qwen3.8-27b) CI fix: merged The 3 failing test shards (windows 22/4, ubuntu 22/3, ubuntu 24/3) all hit the same inherited master red: Verified inherited, not PR-caused: the test fails identically on clean master ( Fix: merged
CI will re-run on the new head. No code changes to the PR itself — pure ci-fixes merge. 八问
判定:PR 分支已含 ci-fixes 修复,CI 重跑应转绿;等 CI 结果确认。 |
(ai: vllm-qwen/qwen3.8-27b) CI green confirmed. Run PR #6993 is ready for review/merge — no further CI action needed. |
What
Two commits, both for #4913 (36% retry→hard-fail rate reported on a local-model deployment):
df673be02mechanical fix — the 【bug】空轮重试门闸把 reasoning 记成可见正文 —— Responses 协议下item.content[]带 reasoning 的退化轮永不重试(客户端拿到空轮) #2756 bare-turn exemption sat below the fatal "degenerated again" branch, so a retry the model left genuinely bare could never pass through; and the qualifying counters (sawThinking/sawStrippedEcho/releasedMarkupChars) accumulated across the retry, so attempt 1's thinking qualified attempt 2. The bare gate now runs first, the per-attempt counters reset when the retry takes over, and the fatal log carries the qualifying signals (sawThinking/sawStrippedEcho/releasedMarkupChars/stalledTail/visibleTextChars/answerChars).3ec1989a5config knob —compat.degenerateTurn: "error" | "passthrough"(default"error", envBILI_DEGENERATE_TURN)."passthrough"opts the plugin chat lane into the pre-Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 terminal: the empty turn passes through as a normal completion — the same terminal the proxy lane and the responses wire already take for this condition.Config surface (AGENTS.md §3)
compat.degenerateTurn: no existing knob could opt out of the fatal terminal — the other two lanes pass this condition through silently, making the chat-pipe fatal branch the outlier.plugin.*(its only current membersnapshotCapBytesis public fork-API config — the name/substance mismatch that got feat: opt-in for non-http(s) baseUrl providers to ride bili (#1392) #1437 rejected as One-shot: named providers as real lanes — bind + compactionOptIn + agent-side switch, landing in a single PR (replaces #1466 staging) #1469).compat.streamErrorShapeby design (same env > file > default wiring; that knob already shapes the error this one can emit)."error"keeps the Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 fatal terminal as the default outcome. Note — commit 1 intentionally changes ONE default slice: a retry attempt the model left genuinely bare (no thinking, no stripped echo, no released markup, no draft/announce tail of its own) now takes the 【bug】空轮重试门闸把 reasoning 记成可见正文 —— Responses 协议下item.content[]带 reasoning 的退化轮永不重试(客户端拿到空轮) #2756 pass-through as a normal empty completion (was: fatal in-band error). Every other gate outcome and every client-visible byte in the default path is unchanged.Verification
158/158 across all 13 affected test files; typecheck clean;
gen-config-docs generateidempotent (CI no-drift);check-coverage,lifecycle-ledger, and config-surface guards pass. Docs updated: seed yaml, env-map (en/zh/ja), hand-written compat sections (en/zh/ja), lifecycle.md §1 ledger.