Skip to content

[PR] fix(plugin): name the qualifying signals on the double-degenerate fatal log line (#4913) - #4918

Open
ranxianglei wants to merge 14 commits into
masterfrom
2026-10-27_degenerate-retry-fatal-log
Open

ranxianglei wants to merge 14 commits into
masterfrom
2026-10-27_degenerate-retry-fatal-log

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Part of #4913 — the observability half (issue change #3: log which signal qualified on the "again after the retry" line). The config-surface switch for the rest is pending owner decision in the issue thread; this PR changes no behavior and needs none.

What

The chat-pipe's #870 fatal in-band stream error fires when the one-shot continuation retry (#732/#821) also ends with zero usable output. The log line was an opaque verdict:

[plugin] degenerate terminal turn again after the retry; emitting an in-band error (#870)

It now names exactly which of the bare-exemption inputs carried the turn, plus the retry's own finish reason:

[plugin] degenerate terminal turn again after the retry; emitting an in-band error (#870): sawThinking=true, sawStrippedEcho=false, releasedMarkupChars=0, draftTail=false, finishReason=stop, visibleTextChars=0

That lets a user attribute their failures without hand-aligning log pairs (e.g. #4913's FP4 thinking-only model: every hard fail is expected to show sawThinking=true + zero visible prose).

Behavior changes

None. Log-line content only — wire bytes, the retry gate, and the #870 error frame are unchanged. The pre-existing #870-path test (tests/issue2303-draft-tail.test.ts "a draft-tail RETRY degenerates into the in-band error") stays green.

Tests

New tests/issue4913-retry-fatal-log.test.ts pins both directions: a thinking-only double-degenerate names sawThinking=true + its finish reason; a released-markup first pass rides a non-zero releasedMarkupChars counter onto the fatal line (documenting that the counter is cumulative across passes — the reset half of issue change #2 belongs to the pending decision).

Local on rebased head: targeted suites green (issue4913/issue2756/issue2303/fix-1760/cache-proof = 48 tests), typecheck clean. Full suite = CI.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-27_degenerate-retry-fatal-log (ccb5615)

Latest build — install this exact version

npm install -g billion-context@0.0.10522-pr.4918.af3cba3

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
ccb5615 billion-context@0.0.10522-pr.4918.af3cba3 build
53813d6 billion-context@0.0.10417-pr.4918.bbd7f62 build
75fbb1b billion-context@0.0.9283-pr.4918.c2c5969 build
38c918a billion-context@0.0.7332-pr.4918.523b404 build
b47670d billion-context@0.0.7120-pr.4918.79d4f45 build
93a2255 billion-context@0.0.7063-pr.4918.5277f91 build
751106a billion-context@0.0.6851-pr.4918.9dc91ab build
de17ad3 billion-context@0.0.6384-pr.4918.31fa8fe build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr4918.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。 GitHub 侧检索 open/closed issue 与 PR:触碰这条 fatal 日志行的只有本 PR(#4918)自己;GitHub #4919(decision request: passthrough toggle design)是 #4913 的配置面开关半边——机制不同(配置面 vs 日志可观测性),且本 PR 明确把它排除在外,不算重复。

审核方式:拉取分支 2026-10-27_degenerate-retry-fatal-log(de17ad3)独立核对代码,本地跑定向套件(issue4913-retry-fatal-log / issue2756-degenerate-gate / issue2303-draft-tail / fix-1760 / cache-proof = 5 文件 48 测试全绿),全量套件以推送头 CI 为准。

结构化八问:

  1. 是什么问题:chat-pipe 的 Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 致命路径(一次性续写重试也零可用输出)触发时,日志只有一句不透明判决 "degenerate terminal turn again after the retry",用户无法判断是哪一个 bare-exemption 输入(sawThinking/sawStrippedEcho/releasedMarkupChars/draftTail)让该回合通过了重试门,归因只能靠手工对齐日志对。
  2. 什么原因导致的:原日志行从未携带门控的输入变量——纯可观测性缺口,不是逻辑缺陷。
  3. 影响范围与严重程度:仅日志行内容;wire 字节、重试门、Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 错误帧均不受影响。严重程度 = 诊断体验缺口(p3 级,无外部行为影响)。
  4. 怎么修复的:把门控实际评估的六个活变量内联进日志行。我逐一核过作用域:sawThinking/sawStrippedEcho/releasedMarkupChars/visibleTextChars 是回合级累加器(src/plugin.ts:2513-2527),draftTail 在 retryEmptyTurn 入口重算(:2598),reason 是该重试通道自己的参数——日志命名的正是决策读取的那组值。已知语义如实披露:前四个计数器跨 pass 累加不重置(retry 接管时只清 filter 状态,src/plugin.ts:2662),PR 正文与新测试都钉死了这一点;重置半边属于 plugin pipe: the degraded turn after a continuation retry will inevitably become a fatal in-band stream error — no toggl | plugin pipe:续写重试后的退化回合必然变成致命 in-band stream error —— 无任何开关,且 #2756 的 "bare" 豁免在重试这一趟根本不会执行 #4913 待 owner 拍板的决策,不在本 PR 范围。
  5. 是否有回归问题:无。触碰路径既有行为逐项清点:Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 的 emitStreamError 调用参数未动(错误帧形状保持 COMPLETED-turn legacy shape,:2620-2624);重试门(CLEAN_TURN_REASONS/bare-exemption/:2632/degenerateRetried)逐字节未动;全仓 grep 确认没有其他测试断言旧日志行字符串(issue2303-draft-tail 的 Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870-path 测试断的是错误帧不是日志行,仍绿);finishReason 取自协议字段(stop/length/tool_calls 一类),无秘密或自由文本注入面,风格与相邻 :2608 行的既有写法一致。
  6. 是否破坏缓存:不涉及(无缓存/重试游标/去重键)。
  7. 是否改了设计方向:不涉及,纯日志增强。
  8. 是否引入新配置:无。

测试有效性:新测试驱动真实入口 pipePluginChatWithStrip,双向硬断言——thinking-only 双退化钉住 sawThinking=true+finishReason=stop;released-markup 首 pass 钉住非零 releasedMarkupChars 并记录跨 pass 累计语义。断言有牙,日志格式或门控输入漂移会抓到。

CI:de17ad3 全绿(test ubuntu/windows × node 22/24 全部 shard + kernel-guard / config-surface-guard / version-guard / lane-guard / static-gates 等守卫),mergeable=true,base=master 无冲突。

判定:可合并。 日志-only、零行为变更、测试钉住语义、CI 全绿。配置面开关半边继续等 #4913 线程的 owner 决策,与本 PR 正交。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

标签: pr scope/wiring p3(请求管道内日志可观测性增强,非缺陷、无外部行为影响)。

@ranxianglei
ranxianglei force-pushed the 2026-10-27_degenerate-retry-fatal-log branch from 6c51654 to 75fbb1b Compare November 12, 2026 06:31
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

APPROVE — log-line-only change, no behavior/wire/config impact.

Verified on the rebased head (75fbb1b):


8问(中文):

  1. 是什么问题: 双退化致命日志行(Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 in-band error)之前是不透明判决("again after the retry"),用户无法归因是哪条信号触发的。
  2. 什么原因导致的: 日志行只写固定文案,没把够格信号(sawThinking/sawStrippedEcho/releasedMarkupChars/draftTail)和重试自身 finish reason 打出来,用户只能手工对齐日志对来还原。
  3. 影响范围与严重程度: 仅影响可观测性(日志内容),不影响任何行为/线上字节/配置面。严重程度:体验瑕疵(调试归因困难),无外部行为影响。
  4. 怎么修复的: 在致命日志行里把六个信号(四个 bare-exemption 输入 + 重试自身的 finish reason + visibleTextChars)插值进去,让 "again after the retry" 可归因。
  5. 是否有回归问题: 无。纯日志行改动,重试门、Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 错误帧、线上字节全部未动;既有 Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 路径测试(issue2303)及相关套件(issue2756/issue2303/fix-1760)本地全绿。
  6. 是否破坏缓存: 不涉及。无缓存/重试/增量游标/去重键变化。
  7. 是否改了设计方向: 不涉及。纯可观测性增强,无架构/边界/数据流转向。
  8. 是否引入了新的配置: 不涉及。无新 env/config/默认值。

判定:可合入(APPROVE)。

Note: the formal GitHub APPROVE review was rejected by GitHub (self-approval — the review bot shares the PR author identity). The verdict is APPROVE; owner can approve and merge.

ci-check and others added 7 commits November 16, 2026 20:38
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]).
Brings in the ci-fixes sentinel fixes for the two inherited master reds
that are not caused by this PR:
- test(#2929): schedule-independent fold probe + hermetic wire shape
  (7247410, supersedes 245ecb1) — fixes the #2929 probe failing on
  every CI shard (win22/4, ubu22/3, ubu24/3)
- docs(architecture): register src/responses-system-sections.ts in the
  module map (8ed56be) — fixes the architecture-docs guard
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

APPROVE — log-line-only change, no behavior/wire/config impact.

Re-reviewed on the new head (ccb5615) after the ci-fixes merge + the stalled-tail signal addition (commit 53813d6).

Verified:


8问(中文):

  1. 是什么问题: 双退化致命日志行(Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 in-band error)之前是不透明判决("again after the retry"),用户无法归因是哪条信号触发的。
  2. 什么原因导致的: 日志行只写固定文案,没把够格信号(sawThinking/sawStrippedEcho/releasedMarkupChars/draftTail/announceTail/stalledTail)和重试自身 finish reason 打出来,用户只能手工对齐日志对来还原。
  3. 影响范围与严重程度: 仅影响可观测性(日志内容),不影响任何行为/线上字节/配置面。严重程度:体验瑕疵(调试归因困难),无外部行为影响。
  4. 怎么修复的: 在致命日志行里把八个信号(bare-exemption 输入含 stalled-tail 子标志 + 重试自身 finish reason + visibleTextChars)插值进去,让 "again after the retry" 可归因。
  5. 是否有回归问题: 无。纯日志行改动,重试门、Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 错误帧、线上字节全部未动;既有 Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 路径测试(issue2303)及相关套件(issue2756/issue2303/fix-1760)本地全绿(21+2 测试)。
  6. 是否破坏缓存: 不涉及。无缓存/重试/增量游标/去重键变化。
  7. 是否改了设计方向: 不涉及。纯可观测性增强,无架构/边界/数据流转向。
  8. 是否引入了新的配置: 不涉及。无新 env/config/默认值。

判定:可合入(APPROVE)。

Note: the formal GitHub APPROVE review is rejected by GitHub (self-approval — the review bot shares the PR author identity). The verdict is APPROVE; owner can approve and merge.

@ranxianglei

Copy link
Copy Markdown
Owner Author

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

Superseded by #6993 — its commit df673be carries the same observability fix (the fatal log now names the qualifying signals, with the same field set plus stalledTail/answerChars), and this branch's log line would conflict with the new one. No remaining unique content. Recommending closure by the owner; no further work planned here.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

Confirmed — this PR is superseded by #6993.

Verified: commit df673be (on master, from #6993) carries both the behavioral fix (bare-exemption gate moved before the fatal branch + per-attempt counter reset) and the observability fix (the fatal log now names the qualifying signals). Its fatal log line:

sawThinking=…, sawStrippedEcho=…, releasedMarkupChars=…, stalledTail=…, visibleTextChars=…, answerChars=…

This PR's log line (head ccb5615) names a different field set (adds draftTail/announceTail/finishReason, omits answerChars). The two lines would conflict if both were merged. Since #6993 is the more comprehensive fix (behavioral + observability) and is already on master, this PR's unique content is fully covered and its log line would be overwritten.

No further work planned here. Awaiting owner closure.

ranxianglei pushed a commit that referenced this pull request Nov 17, 2026
…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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant