Skip to content

[PR] fix(loop): retry stalled bare-announcement terminal turns (#4944) - #4935

Closed
fathonix wants to merge 12 commits into
ranxianglei:masterfrom
fathonix:fix/announcement-tail-retry
Closed

fathonix wants to merge 12 commits into
ranxianglei:masterfrom
fathonix:fix/announcement-tail-retry

Conversation

@fathonix

@fathonix fathonix commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

PR 2: fix(loop): retry stalled bare-announcement terminal turns (#4944)

Fixes #4944

Problem / Background

Certain chat-optimized models (notably DeepSeek and other open-weights instruction models) occasionally emit a short single-line announcement promise (e.g. "Let me run the tests now:", "Checking the logs...", "Running verify after formatting:") and stop cleanly without emitting any tool calls (tool_calls: [], finish_reason: "stop").

In Billion-Context proxy environments, this failure mode is exacerbated when prompt guidance or ACP tool markers introduce slight turn distraction. The model intends to run a tool, emits an introductory colon-terminated statement, but hits an empty completion turn. The harness/user is left waiting on an unfinished sentence with no follow-up action executed.

Existing mitigations handle empty turns (#821) and incomplete draft closes (#2303 / endsWithDraftClose), but bare announcements terminating with a colon or ellipsis fell through and ended the loop prematurely.

Mechanism & Changes

  • src/degenerate-turn.ts:
    • Implemented endsWithAnnouncement(text: string): boolean.
    • Identifies short candidate turns (< 400 chars, no markdown code fence open) ending with : or ... / …, accompanied by common action announcement verbs (running, checking, testing, inspecting, let me, etc.).
  • src/loop/core.ts:
    • Hooked announcement detection into the compression loop evaluation.
    • When a model turn finishes cleanly without tool calls but matches endsWithAnnouncement(), injects a single-shot continuation retry (acp_draft_tail_retry_r${round}) nudging the model to proceed with execution.
    • Guarded by loop bounds: fires at most once per turn sequence to prevent infinite loops if the model persistently refuses to call tools.
  • src/plugin.ts:
    • Integrated endsWithAnnouncement check into plugin terminal tail validation.
  • tests/issue3905-announcement-tail.test.ts:
    • Added unit test suite covering announcement detection patterns, false-positive exclusions (normal prose ending with a colon inside explanations, code snippets, lists), and loop retry triggering.

Verification

  • Added test suite tests/issue3905-announcement-tail.test.ts verifying positive matches ("Running tests:", "Checking the output...") and negative controls.
  • Validated that terminal announcements trigger continuation retry, recovering tool execution instead of stalling.

@ranxianglei ranxianglei changed the title fix(loop): retry stalled bare-announcement terminal turns (#3905) [PR] fix(loop): retry stalled bare-announcement terminal turns (#3905) Oct 27, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 —— 「裸宣告式终止轮」(模型只说一句 "Running verify after formatting:" 就干净停轮、无工具调用) 这个症状在 open+closed issue 里无同题;与 #2303(draft 尾 </summary>/</analysis>)、#732/#821(零可见输出空轮)同属「终止轮未收敛」家族但形状不同(无 draft 标签、有可见短文本),机制上复用它们的 one-shot nudge 预算是正确归位。

但审核发现几个必须先处理的问题,按严重度列:

1. issue 引用错了(硬伤)。 标题和正文都写 Fixes #3905,但 #3905 是「bili 把 x-bili-plugin* 宿主头转发到上游模型端点——出站剥离缺口」,已关闭,由 #3915 修复,与本 PR 毫无关系。本 PR 要修的问题目前没有对应 issue。我会按仓库规则补立一个带来源标记的 issue 并回链本 PR。

2. 范围混装:把 #3906 的 streamMarkers 改动塞进了本 PR。 src/loop/core.ts 里新增的 LoopCtx.streamMarkers 字段 + emitMarker 发射门(if (ctx.streamMarkers !== false))属于你另一个 PR #4934(streamMarkers 配置)。两个 PR 在 LoopCtx 同一位置加同一个字段,先合哪个另一个都撞文本冲突——这是典型的合入顺序依赖链。处置:把 streamMarkers 相关 hunk 从本 PR 剥掉,全部归 #4934,让每个 PR 各自闭环。

3. 正文描述与实现不符,且漏掉的正是精度边界。 正文说检测器要求「伴随常见动作宣告动词(running/checking/testing/let me 等)」且「无未闭合 markdown 代码栅栏」,实际实现只有「≤400 字符 + 以 :/…/... 结尾」。后果:任何 ≤400 字符、以冒号或省略号收尾的合法短回答(比如 "The answer is 42:"、"I'm not sure…")都会触发一次额外的计费重试——测试文件自己都写了 "The answer is 42:" → true 并标注 "documented cost",但这个成本没有 owner 签认。按你自己的设计意图把动词门 + 栅栏检查补进实现(这同时消除上面那个 documented cost 案例)。

4. 测试缺口 + 死导入。 测试文件 import 了 pipePluginChatWithStrip / pipePluginResponsesWithStrip 却一次没用——而 plugin 车道恰恰是误报面最大的地方(它绕过了 answerChars 答案门,比 loop 车道多一层行为变化),两条 plugin 管道零覆盖。死导入删除,plugin 车道补负控测试。

5. 行为变更未披露。 旧行为:这类短宣告轮正常结束;新行为:隐藏地多发一次 completion(计费 + 延迟)。PR 正文没有任何 old→new 披露,我会在对齐 commit 后补进 PR 描述。

方向判定:问题真实存在(生产 stub 证据 ses_eb6da0d60ffeYpnNQDoGz000Pc,deepseek-v4.1-flash,24 输出 token),机制归位正确(loop 门完整继承 #2303 的全部守卫:one-shot 预算、wire 边界、#2612 compaction 豁免、abort 检查),不是症状层打补丁。方向通过,按上述 1–5 做对齐重构。

接下来我会直接往你的分支推标注清晰的修复 commit(外部 PR 质量不达标走直接对齐,不拉锯),补立缺失 issue,然后看 CI。有问题随时喊停。

ci-check added 3 commits October 27, 2026 16:25
… PR ranxianglei#4934

Align-refactor (review of ranxianglei#4935): this PR is scoped to the bare-announcement
terminal-turn retry (ranxianglei#3905 symptom), but it also carried the LoopCtx
streamMarkers field and the emitMarker consumption gate that belong to the
streamMarkers setting feature. That feature has its own PR (ranxianglei#4934, which
wires the config surface but lacks these two hunks) — keeping them here makes
ranxianglei#4934 unable to compile standalone and creates a merge-order dependency
between two independent features. The hunks move to ranxianglei#4934 so each PR is a
closed loop.
…he PR body describes

Align-refactor (review of ranxianglei#4935): the PR body promises detection is
'accompanied by common action announcement verbs' and requires 'no markdown
code fence open', but the shipped detector was tail-char + length only — any
turn under 400 chars ending in ':' or ellipsis qualified, including legitimate
short answers ('The answer is 42:') that would now cost an extra billed
completion call each. Implement both promised gates: an ANNOUNCE_CUE word list
(progressing forms + intent phrases only, mirroring the body's examples) and a
reject on odd backtick-fence count (an unclosed fence is the ranxianglei#1755/ranxianglei#2190
truncation class, not a stall). English-first by design: non-English
announcements keep the pre-ranxianglei#3905 no-retry behavior until traffic evidence
justifies extending the cue list.
…ei#2303 sibling; pin the 400-char cap

Align-refactor (review of ranxianglei#4935): the suite only covered unit + compress-loop
lanes while the change also rewires pipePluginChatWithStrip and
pipePluginResponsesWithStrip terminal classification — the ranxianglei#2303 sibling
suite covers all three lanes, so match that bar: plugin chat positive
(ranxianglei#3905 log line, one [DONE], single finish_reason stop), colon-answer and
ellipsis-answer negatives, tool-call exclusion, retry-degenerates in-band
error (ranxianglei#870); responses-pipe mirror set. Also fix at-l3, whose 'long answer'
fixture did not actually end on the tail char and passed for the wrong reason
— the rewritten fixture (441 chars, cue-bearing, colon tail) pins the length
cap itself at loop level. Drop dead imports.
ranxianglei pushed a commit to fathonix/billion-context that referenced this pull request Oct 27, 2026
Align-refactor (review of ranxianglei#4935): this PR defines the streamMarkers field on
LoopCtx and wires the config surface end-to-end, but nothing ever reads the
field — the emission gate that honors it was shipped in PR ranxianglei#4935 (the
announcement-retry PR), which makes this setting a dead knob on its own and
couples the two PRs into a merge-order dependency. Move the consumption gate
(and its failure-mode comment) here from ranxianglei#4935 so each PR is a closed loop.
Behavior with the default (unset) is unchanged: markers still stream.
ranxianglei pushed a commit to fathonix/billion-context that referenced this pull request Oct 27, 2026
…rs (ranxianglei#2107)

Align-refactor (review of ranxianglei#4935): the PR's website/config-reference/compress.yaml
seed edit was committed without re-running tools/gen-config-docs.mjs, so the
ranxianglei#2107 docs-sync drift guard goes red on this head. Regenerate the four derived
artifacts (CONFIGURATION.md / CONFIGURATION.zh-CN.md / website/main.js /
website/docs/index.html) — content is exactly the new streamMarkers row plus
its BILI_STREAM_MARKERS env index entry.
…roseAcc (ranxianglei#3905)

proseAcc accumulates every streamed text field including the thinking/
reasoning channel. endsWithAnnouncement(proseAcc) therefore saw the tail of
the model's internal monologue: a thought ending mid-sentence on ':' or an
ellipsis followed by a whitespace-only answer was reclassified as a bare
announcement (the new ranxianglei#3905 branch) instead of the ranxianglei#2756 degenerate shape —
the retry still fired but under the wrong log line, and a whitespace-only
turn on an unclean finish lost its 'not retried ... not a clean stop'
refusal log entirely (stalledTail suppressed it). Two subtests in
tests/issue2756-degenerate-gate.test.ts went red on every shard-3 CI leg.

Operand swap to answerProse in both plugin pipes (chat + responses). The
compress-loop twin already tests text-only assistantText and is unaffected.
@ranxianglei ranxianglei added bug Something isn't working dsh p2 scope/wiring labels Oct 27, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

Review 结论:外部提交 → 按政策 ②a 直接对齐重构,全部完成并推回你的分支。代码已收敛,CI 绿,待 owner 合并判定。

标签: bug / dsh / p2 / scope/wiring —— 缺陷类;生产证据来自 dsh 车道 deepseek combo;属请求管道终端轮分类;可用但会停摆(手动 nudge 可绕行)。

结构化八问

  1. 是什么问题:模型用一句短动作宣告("Running tests:" / "Checking the logs…")收尾、一个工具调用都没发、stop 正常结束 → 循环提前终止,用户停在半句话前,必须手动再发一条才能继续。
  2. 什么原因导致的:loop 层已有两类退化终端轮重试([BUG] In some cases, with Codex's auto model + DeepSeek, it will suddenly terminate automatically. #732/workbuddy报错Empty stream: upstream gateway sent only placeholder chunks without any model output (chunks=0, bytes=0) #821 全空轮、DSH native mode: assistant text ending with </summary> is treated as a completed step, so the turn silently stops (149 samples from session transcripts) #2303 未闭合草稿标签),裸宣告不匹配任何现有检测器 → 形状覆盖缺口,不是上游模型 bug。
  3. 影响范围与严重程度:只影响偶尔发出该形状的 chat 优化模型(DeepSeek 等);会话可用但该轮停摆,绕行 = 手动再发消息 → p2。
  4. 怎么修复的:新增 endsWithAnnouncement() 检测器(≤400 字符 + 尾部 :/…/... + 动作线索词 + 代码围栏闭合),接入 compress-loop 重试门与 plugin chat/responses 两条终端分类路径;复用 DSH native mode: assistant text ending with </summary> is treated as a completed step, so the turn silently stops (149 samples from session transcripts) #2303 的一次性续写 nudge 机制(degenerateRetried 守卫,每个回合序列至多一次),重试后仍退化则按 Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 回带内错误,不静默挂起。
  5. 是否有回归问题:逐项审过——空轮路径不变(announce 要求非空文本);DSH native mode: assistant text ending with </summary> is treated as a completed step, so the turn silently stops (149 samples from session transcripts) #2303 draft-tail 路径不变(draft 分支优先,sibling 套件全绿);finish=length 语义不变(loop 车道照旧重试、plugin 车道不重试,与 DSH native mode: assistant text ending with </summary> is treated as a completed step, so the turn silently stops (149 samples from session transcripts) #2303 原有不对称一致);[bug] bili claude: #2303 draft-tail 重试把 Claude Code 自己的压缩回复(以 </summary> 结尾)当坏草稿打断,/compact 与 auto-compact 全部失败 #2612 散文摘要豁免继承;[Question] zocde调用子智能体的时候,子智能体有概率出错,导致子智能体停止工作 #862 visibilityMarkers 路径不受影响(混入的 streamMarkers hunk 已拆走)。误报面被 cue+fence 门收窄。未发现回归。
  6. 是否破坏缓存:不涉及——只对特定退化回合多一次续写重请求(与 DSH native mode: assistant text ending with </summary> is treated as a completed step, so the turn silently stops (149 samples from session transcripts) #2303 同机制),不动任何缓存/游标/去重策略。
  7. 是否改了设计方向:无——退化终端轮机制族内的纯扩展。
  8. 是否引入新配置:无。(原混入本 PR 的 streamMarkers 设置属 [PR] feat(compress): add streamMarkers setting to suppress streaming receipts (#3906) #4934/Plugin lanes: host declares exposed bili tools per request via x-bili-plugin-exposed-tools (structural fix for #3884/#3600 name-guessing) | 插件车道:宿主按请求声明暴露的 bili 工具(根治 #3884/#3600 认名字脆弱性) #3906,已拆回那边。)

行为变更披露(旧→新):旧 = 以冒号/省略号收尾的短轮正常完成;新 = 其中带动作线索词的 ≤400 字符轮会触发一次额外计费的 completion 调用,无线索词短轮行为不变。原因 = 找回停摆回合的工具执行;成本有界(每回合序列至多一次)。注意 English-first:非英文宣告保持修复前行为,直到有流量证据支持扩线索表。

本轮动作(均为推回你分支的 additive commit,未 rebase)

验证证据:本地定向测试 33/33(issue3905 + issue2303 双套件)、typecheck exit 0、visibility-markers 套件 10/10(#4934 分支);全量回归按纪律交远程 CI——本 PR head 206ddc9 CI 已全绿;#4934 新 head 43371be CI 重跑中(docs-sync 将得到验证)。

另注:#4934 自身没有针对新设置行为的测试(streamMarkers=false 时流上回执确实消失而历史标记保留),建议在其自己的 review 车道补齐——不在本 PR 扩面。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

CI auto-fix lane (attempt 1/2) — 根因定位、已修复、已推送。 新头 76c98b8ae,GitHub 已对新头排队新一轮 CI。

查重: 不重复 —— #4599 记录的 master 侧红是 tests/registry-unsupported-proxy.test.ts(3-way shard 2 / 5-way shard 5 分区);本次三个红 job 全部落在 shard 3,失败文件不同,非 master 继承问题,亦无既有修复在途。

时间线说明: 分析期间作者推了 3 个新 commit(fa60f8f 剥离 #3906 streamMarkers hunk → 归 #4934 所有;aec1e1b 给 detector 补 action-cue + closed-fence 两道精度门;206ddc9 补 plugin-lane 测试并钉住 400 字符上限)。我的修复已 rebase 到 206ddc9 之上,fast-forward 推送,未 force-push,未动作者的 commit。

结构化八问:

  1. 是什么问题: PR 新增的裸公告检测(announceTail)在两条 plugin 管道里喂错了文本源——喂的是 proseAcc,而它累积包括 thinking/reasoning 在内的所有流式文本字段。于是「思考以冒号/省略号结尾 + 可见回答为空白」的回合被误判成 bili forwards all x-bili-plugin* host headers (and its own chain markers) to upstream model endpoints — egress strip gap | bili 把全部 x-bili-plugin* 宿主头(及自身链标记)转发给上游模型端点——出站剥离缺口 #3905 裸公告,而不是它本来的 【bug】空轮重试门闸把 reasoning 记成可见正文 —— Responses 协议下 item.content[] 带 reasoning 的退化轮永不重试(客户端拿到空轮) #2756 退化形态:tests/issue2756-degenerate-gate.test.ts 的两个日志契约子测试确定性失败,ubuntu-22 / ubuntu-24 / windows-22 的 shard 3 三条腿全红。
  2. 什么原因导致的: 机制层错误——plugin 管道的 endsWithAnnouncement(proseAcc) 检测的是「内部独白的尾巴」而不是「用户可见回答的尾巴」。loop 侧(src/loop/core.ts)一直用只含 text 字段的 assistantText,plugin 侧与之背离。作者后加的 action-cue 门只是让观测到的那个实例恰好不再命中(其思考文本不含 cue 词),机制本身仍在:任何含 cue 词且以 :/… 收尾的思考 + 空白回答仍会误判。
  3. 影响范围与严重程度: 仅 plugin 模式、模型输出 thinking 且可见回答为空白(或尾部恰好是冒号/省略号)的低频形状。后果是诊断日志错行(按 bili forwards all x-bili-plugin* host headers (and its own chain markers) to upstream model endpoints — egress strip gap | bili 把全部 x-bili-plugin* 宿主头(及自身链标记)转发给上游模型端点——出站剥离缺口 #3905 记而非 [BUG] In some cases, with Codex's auto model + DeepSeek, it will suddenly terminate automatically. #732/workbuddy报错Empty stream: upstream gateway sent only placeholder chunks without any model output (chunks=0, bytes=0) #821)+ 非干净停下的回合丢失「not retried … not a clean stop」拒退日志;重试本身仍会触发,无用户可见 stall 回归。严重度:CI 契约破坏 + 可观测性缺陷,无数据丢失。
  4. 怎么修复的: 机制级操作数替换——chat 与 responses 两条管道改喂 answerProse(可见回答累加器,与 loop 侧同源语义);draftTail(DSH native mode: assistant text ending with </summary> is treated as a completed step, so the turn silently stops (149 samples from session transcripts) #2303)有意保持 proseAcc 不动。实质改动两行,附注释说明为何必须用回答文本。
  5. 是否有回归问题: 审过 endsWithAnnouncement/endsWithDraftClose 的全部消费点(src/loop/core.ts、src/plugin.ts×2、两个测试文件,48 处引用逐一核对);新头本地跑完全部 28 个 import 这两条 pipe 的测试套件 337/337 绿,typecheck 清洁。行为变更披露(旧→新): 真实公告(如 "Running verify after formatting:")的重试触发集不变;被思考污染的空白回答形从「bili forwards all x-bili-plugin* host headers (and its own chain markers) to upstream model endpoints — egress strip gap | bili 把全部 x-bili-plugin* 宿主头(及自身链标记)转发给上游模型端点——出站剥离缺口 #3905 标签下重试」改走 【bug】空轮重试门闸把 reasoning 记成可见正文 —— Responses 协议下 item.content[] 带 reasoning 的退化轮永不重试(客户端拿到空轮) #2756 退化通道——干净停下时重试保留,非干净停下时恢复显式拒退日志。属日志分类修正,无阈值/时序漂移。
  6. 是否破坏缓存: 不涉及——未触碰缓存/游标/去重键,纯流尾分类。
  7. 是否改了设计方向: 没有——把 plugin 侧对齐到 loop 侧既有的操作数选择(text-only),消除两侧分叉。
  8. 是否引入了新的配置: 没有。

验证与状态: 本地定向复现(两条腿的失败子测试)+ 全量 blast-radius(337 断言)+ typecheck 均在新头通过;已推送 206ddc9..76c98b8ae 到 PR 分支,新一轮 CI 排队中。结论已在 #4599 留一行记录。

@fathonix fathonix changed the title [PR] fix(loop): retry stalled bare-announcement terminal turns (#3905) fix(loop): retry stalled bare-announcement terminal turns (#4944) Oct 27, 2026
@ranxianglei ranxianglei changed the title fix(loop): retry stalled bare-announcement terminal turns (#4944) [PR] fix(loop): retry stalled bare-announcement terminal turns (#4944) Oct 27, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) Merge guard sync: merged origin/master into this branch (new head 90db83f, fast-forward, zero conflicts — both sides' changes verified intact in src/degenerate-turn.ts / src/loop/core.ts / src/plugin.ts; PR regression suite 19/19 green + typecheck clean on the merged tree locally). State after push: no longer behind, mergeable, CI lanes re-running (queued) on the new head.

Resolve the single src/loop/core.ts import conflict (union of the ranxianglei#3905
endsWithAnnouncement addition with master's scrubLoneSurrogateEscapesOnJson
rename) and align the ranxianglei#3905 ranxianglei#870 in-band-error test assertion to master's
ranxianglei#5958 protocol-native error-frame default (was the legacy [ACP] stream error
completion shape).
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

Conflict resolved and pushed. I merged origin/master into the PR head branch and resolved the one real conflict.

What I did this run:

  1. Identified the PR's head: branch fix/announcement-tail-retry in fork fathonix/billion-context (base master). The PR had branched from master at 44067a5 (2026-10-30); master had since advanced 1369 commits → the conflict.
  2. Merged origin/master into the branch (merge, not rebase — it's an external fork and the contributor's own syncs are merge commits; this preserves their history/authorship and needs no force-push).
  3. Resolved the single conflict in src/loop/core.ts (import block only): kept the PR's endsWithAnnouncement import (used at core.ts:1285) and took master's scrubLoneSurrogateEscapesOnJson (used at core.ts:591/612), dropping scrubLoneSurrogatesOnWire which was only in the stale import and unused in the body. Union of intent, no behavior change.
  4. The merge surfaced one stale test: tests/issue3905-announcement-tail.test.ts release v0.1.3 #10 asserted the legacy "[ACP] stream error" string, but master's [dsh] Retry-exhausted degenerate turn is serialized as successful completion (0.1.213) #5958 changed emitStreamError's default shape to the protocol-native error frame. I confirmed the failure was merge-induced (all 19 tests pass on the PR head alone) and updated the assertion to check the native openai frame ("code":"stream_error" + the bili forwards all x-bili-plugin* host headers (and its own chain markers) to upstream model endpoints — egress strip gap | bili 把全部 x-bili-plugin* 宿主头(及自身链标记)转发给上游模型端点——出站剥离缺口 #3905 message). Test intent preserved.
  5. Verified: npm run typecheck PASS; the PR's targeted suites (issue3905 + plugin-fork + loop-degenerate-retry) 87/87 PASS.
  6. Pushed to fathonix/fix/announcement-tail-retry (fast-forward, no force). PR merge state is now blocked (mergeable — the conflict is gone; it's waiting on CI), not dirty.

CI checks: 24 queued, 0 failed (just started after the push). Full-suite verdict comes from CI.


八问

  1. 是什么问题:PR 与 master 冲突(merge state dirty),无法合并;合并后 PR 自带的一个测试因 master 的 [dsh] Retry-exhausted degenerate turn is serialized as successful completion (0.1.213) #5958 改动而失败。
  2. 什么原因导致的:PR 基于旧 master(44067a5,2026-10-30)分叉,master 已前进 1369 个提交。冲突是 src/loop/core.ts 的 import 分歧;测试失败是 [dsh] Retry-exhausted degenerate turn is serialized as successful completion (0.1.213) #5958 把 emitStreamError 默认 errorShape 从 legacy "completion"(含 "[ACP] stream error")改为 "protocol"(原生错误帧),而 PR 测试断言的是旧字符串。
  3. 影响范围与严重程度:冲突阻塞 PR 合并(可用性:PR 卡住无法合入)。测试失败是合并引入的假阳性——行为本身正确,只是断言过期。
  4. 怎么修复的:把 origin/master 合并进 PR 分支(非 rebase,保留外部贡献者历史、免 force-push);import 冲突按「意图并集」解决;过期测试断言更新为匹配 [dsh] Retry-exhausted degenerate turn is serialized as successful completion (0.1.213) #5958 的原生错误帧。
  5. 是否有回归问题:合并本身无行为变更(import-only 冲突,按意图并集解决);测试修复保留原测试意图(客户端通过原生错误帧被告知)。typecheck + 87 个定向测试通过;全量回归由 CI 把关。
  6. 是否破坏缓存:不涉及——未触碰任何缓存/重试/游标/去重逻辑,仅 import 解析 + 一个测试断言。
  7. 是否改了设计方向:不涉及——无架构/边界/数据流变更。
  8. 是否引入了新的配置:不涉及——无新 env/config/默认值。

结论:冲突已解决并推送,PR 现为可合并(blocked = 等 CI),等待 CI 全绿后即可由人工合并。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

Status check (no new work needed) — this forward's dirty state is stale.

I verified the LIVE state this run (not from memory):

  • Merge state: mergeable: True, mergeable_state: blocked — not dirty. The conflict was already resolved and pushed in the prior run (merge commit b7846b34ae).
  • Head unchanged: b7846b34ae on fathonix/fix/announcement-tail-retry; no other agent pushed to the branch since.
  • CI is now fully green: 30 checks, 0 failed, 0 pending — all test shards (ubuntu+windows, node 22/24), static-gates, mysql-contract, and kernel-guard are success; the e2e/theorem lanes are skipped (gated, as expected).

So the PR is mergeable and CI-clean — this forward was a duplicate/stale conflict detection that landed after my fix. Nothing new to do; it's ready for a human to merge.

八问(本轮仅做状态核实,无新改动)

  1. 是什么问题:系统转发再次报 PR 冲突(dirty)——实为上一轮已解决并推送后的过期重复检测。
  2. 什么原因导致的:镜像轮询在我上轮推送(b7846b34ae)落地前就检测到冲突并转发,转发到达时冲突已不复存在。
  3. 影响范围与严重程度:无实际影响——PR 当前可合并、CI 全绿。
  4. 怎么修复的:本轮未做修复;仅用只读 API + 镜像缓存核实实时状态,确认冲突已解、CI 已绿。
  5. 是否有回归问题:不涉及(本轮无代码改动)。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

结论:冲突已解(上轮)、CI 全绿(本轮核实),PR 处于可合并状态,等待人工合并。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

PR review 结论(独立审核,非复读 issue 侧)—— 可合。

查重: 不重复。 本 PR 修「裸宣告式终止轮」(模型只说一句 "Running verify after formatting:" 就干净停轮、无工具调用)。与同族 #2303(未闭合草稿标签 </summary>)、#732/#821(零可见输出空轮)症状同属「终止轮未收敛」,但形状互斥(有可见短文本 / 无 draft 标签 / 无工具调用),机制上复用它们共享的一次性 nudge 预算(degenerateRetried)是正确归位,非重复立项。

本轮独立动作(不复读 floor 3/4):重取当前 head b7846b34ae 对正确 base(master c26c31ace4,PR 已全含 master、无冲突)的 diff——4 文件 / 511 增 / 20 删;逐段读了三车道(压缩 loop、plugin chat、plugin responses)完整控制流,核对 detector 三道精度门、一次性预算、#870 in-band 错误路径、#2612 豁免;通读 420 行新测试。CI 现态(head 未变):54 check = 39 success + 15 skipped(门控 e2e/theorem 车道)+ 0 failed,绿。

结构化八问

  1. 是什么问题:某些 chat 优化模型(DeepSeek 等)偶尔只发一句短动作宣告("Running tests:" / "Checking the logs…")就干净停轮、一个工具调用都不发 → 循环提前终止,用户停在半句话前,必须手动再发一条才能继续。
  2. 什么原因导致的:loop/plugin 已有两类退化终止轮重试([BUG] In some cases, with Codex's auto model + DeepSeek, it will suddenly terminate automatically. #732/workbuddy报错Empty stream: upstream gateway sent only placeholder chunks without any model output (chunks=0, bytes=0) #821 全空轮、DSH native mode: assistant text ending with </summary> is treated as a completed step, so the turn silently stops (149 samples from session transcripts) #2303 未闭合草稿标签),裸宣告不匹配任何现有检测器 → 形状覆盖缺口;修的是「检测器缺这一形状」这个根因,不是症状层打补丁,也不是上游模型 bug。
  3. 影响范围与严重程度:只影响偶尔发出该形状的 chat 优化模型;会话可用但该轮停摆,绕行 = 手动再发消息 → p2。
  4. 怎么修复的:新增 endsWithAnnouncement()(≤400 字符 + 尾部 :/…/... + 动作线索词 + 代码围栏闭合——三道门各挡一类合法短回答误报),接入三车道;复用 DSH native mode: assistant text ending with </summary> is treated as a completed step, so the turn silently stops (149 samples from session transcripts) #2303 一次性续写 nudge(共享 degenerateRetried 预算,每请求序列至多一次),重试再退化 → 走 Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 in-band 错误,不静默挂起、不死循环。
  5. 是否有回归问题:逐项独立核过——DSH native mode: assistant text ending with </summary> is treated as a completed step, so the turn silently stops (149 samples from session transcripts) #2303 draft-tail 路径字节不变(stalledTail==="draft" 在外层 assistantText.length>0 && calls.length===0 下 ⟺ 原 endsWithDraftClose;plugin 侧 draftTail 仍读 proseAcc 未动);[BUG] In some cases, with Codex's auto model + DeepSeek, it will suddenly terminate automatically. #732/workbuddy报错Empty stream: upstream gateway sent only placeholder chunks without any model output (chunks=0, bytes=0) #821 空轮路径未触碰;[bug] bili claude: #2303 draft-tail 重试把 Claude Code 自己的压缩回复(以 </summary> 结尾)当坏草稿打断,/compact 与 auto-compact 全部失败 #2612 散文摘要豁免继承;Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870 in-band 错误路径继承(chat 管道);responses 管道「重试再退化→return false 不发 in-band 错误」是既有不对称、本 diff 未触碰(非本 PR 引入)。唯一新增行为是 announce 重试,被三道精度门 + 一次性预算收窄。未发现回归。
  6. 是否破坏缓存:不涉及——只对特定退化回合多一次续写重请求(与 DSH native mode: assistant text ending with </summary> is treated as a completed step, so the turn silently stops (149 samples from session transcripts) #2303 同机制),不动任何缓存/游标/去重键。
  7. 是否改了设计方向:无——退化终止轮机制族内的纯扩展。
  8. 是否引入新配置:无。

行为变更披露(旧→新,Deliverables 第 4 条):旧 = 以冒号/省略号收尾的短轮正常完成;新 = 其中 ≤400 字符、带动作线索词、代码围栏闭合的轮会触发一次额外计费的 completion 调用(一次性预算封顶,重试再退化走 #870 错误而非循环)。残留误报面:含 "let me"/"i'll" 等线索词的合法收尾句若恰以省略号结尾仍会触发(有界、低频)。English-first:非英文宣告保持修复前行为,直到有流量证据扩线索表。

已知非阻塞项(需 owner/系统侧,agent 无权改 PR 标题/正文):PR 标题/正文引用 Fixes #3905,但 #3905 是无关的已关闭 issue(出站头剥离缺口,已由 #3915 修复);正确父 issue 是 #4944(floor 4 已补立,带 [no-dispatch])。引用改指需 owner/系统侧操作。

判定:可合。 方向对(修根因非打补丁)、无回归、测试有牙(三车道 × 正反 × 一次性预算 × #870 × 400 上限 × 工具调用排除 × 围栏排除 × #2303 同侪对齐)、diff 干净(4 文件全相关,无跑题/无空白 churn/无 lockfile)、CI 绿。等 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

Third identical dirty forward — live state confirms there is no conflict. (I re-verified everything live this run, not from memory.)

  • Merge state: mergeable: True, mergeable_state: behind — not dirty. The PR head is b7846b34ae (unchanged since my prior fix); master has advanced only 5 commits past the PR base.
  • No conflict, proven locally: git merge-tree of the PR head into the real latest master (9674cfaf, 2026-11-12T06:06Z) returns clean (exit 0, no conflict output). GitHub's own mergeable: True agrees.
  • CI green: 30 checks, 0 failed, 0 pending (all test shards, static-gates, mysql-contract, kernel-guard success; e2e/theorem skipped/gated).

The behind state is normal and does not block merging — it just means master moved a little. Re-merging master into the PR again would only add a redundant merge commit and re-trigger CI for no benefit, so I'm not doing that.

Net: nothing to fix. The PR is mergeable and CI-clean; it's ready for a human to merge. The repeated dirty forwards look like a stale mirror-poller cache, not a real regression.

八问(本轮仅实时核实,无代码改动)

  1. 是什么问题:系统第三次转发 PR 冲突(dirty)——实时核实后确认不存在冲突。
  2. 什么原因导致的:镜像轮询缓存了过期的 dirty 状态;实际 PR 头 b7846b34ae 未变,master 仅前进 5 个提交。
  3. 影响范围与严重程度:无实际影响——PR 可合并、CI 全绿。
  4. 怎么修复的:本轮未做修复;用只读 API + git merge-tree 本地干跑合并,证明对真实最新 master(9674cfaf)无冲突。
  5. 是否有回归问题:不涉及(无代码改动)。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

结论:无冲突、CI 全绿,PR 处于可合并(behind)状态,等待人工合并;不额外制造合并提交。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner

Landed via batch PR #6482 (merged) — closing as superseded.

@ranxianglei ranxianglei reopened this Nov 14, 2026
ranxianglei pushed a commit to Louie0806/billion-context that referenced this pull request Nov 14, 2026
… PR ranxianglei#4934

Align-refactor (review of ranxianglei#4935): this PR is scoped to the bare-announcement
terminal-turn retry (ranxianglei#3905 symptom), but it also carried the LoopCtx
streamMarkers field and the emitMarker consumption gate that belong to the
streamMarkers setting feature. That feature has its own PR (ranxianglei#4934, which
wires the config surface but lacks these two hunks) — keeping them here makes
between two independent features. The hunks move to ranxianglei#4934 so each PR is a
closed loop.

(cherry picked from commit fa60f8f)
ranxianglei pushed a commit to Louie0806/billion-context that referenced this pull request Nov 14, 2026
…he PR body describes

Align-refactor (review of ranxianglei#4935): the PR body promises detection is
'accompanied by common action announcement verbs' and requires 'no markdown
code fence open', but the shipped detector was tail-char + length only — any
turn under 400 chars ending in ':' or ellipsis qualified, including legitimate
short answers ('The answer is 42:') that would now cost an extra billed
completion call each. Implement both promised gates: an ANNOUNCE_CUE word list
(progressing forms + intent phrases only, mirroring the body's examples) and a
reject on odd backtick-fence count (an unclosed fence is the ranxianglei#1755/ranxianglei#2190
truncation class, not a stall). English-first by design: non-English
announcements keep the pre-ranxianglei#3905 no-retry behavior until traffic evidence
justifies extending the cue list.

(cherry picked from commit aec1e1b)
ranxianglei pushed a commit to Louie0806/billion-context that referenced this pull request Nov 14, 2026
…ei#2303 sibling; pin the 400-char cap

Align-refactor (review of ranxianglei#4935): the suite only covered unit + compress-loop
lanes while the change also rewires pipePluginChatWithStrip and
pipePluginResponsesWithStrip terminal classification — the ranxianglei#2303 sibling
suite covers all three lanes, so match that bar: plugin chat positive
(ranxianglei#3905 log line, one [DONE], single finish_reason stop), colon-answer and
ellipsis-answer negatives, tool-call exclusion, retry-degenerates in-band
error (ranxianglei#870); responses-pipe mirror set. Also fix at-l3, whose 'long answer'
fixture did not actually end on the tail char and passed for the wrong reason
— the rewritten fixture (441 chars, cue-bearing, colon tail) pins the length
cap itself at loop level. Drop dead imports.

(cherry picked from commit 206ddc9)
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

Acknowledged — superseded, no action taken. I verified the supersession is real (live, not from memory):

So I am not resolving the conflict (no point on a superseded PR) and not closing it (close is your action, not the agent's). The dirty forward is expected fallout from #6482 landing the same changes into master. Ready for you to close #4935 as superseded.

八问(本轮仅核实 supersede,无代码改动)

  1. 是什么问题:PR 被批量 PR [PR] chore(batch): land 29 open fragmented fixes in one history-preserving batch #6482 取代(superseded),无需再修冲突。
  2. 什么原因导致的:[PR] chore(batch): land 29 open fragmented fixes in one history-preserving batch #6482 已把本 PR 的 bili forwards all x-bili-plugin* host headers (and its own chain markers) to upstream model endpoints — egress strip gap | bili 把全部 x-bili-plugin* 宿主头(及自身链标记)转发给上游模型端点——出站剥离缺口 #3905 修复(endsWithAnnouncement + announcement-tail retry + 测试)合入 master,本 PR 分支与合入后的 master 产生冲突,但内容已被取代。
  3. 影响范围与严重程度:无——工作已在 master,本 PR 无独有内容。
  4. 怎么修复的:本轮不修复;核实 [PR] chore(batch): land 29 open fragmented fixes in one history-preserving batch #6482 已合并且其 merge commit 恰好改动本 PR 的四个文件,确认 supersede 成立。
  5. 是否有回归问题:不涉及(无代码改动)。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

结论:supersede 成立(#6482 已合并、内容已入 master),本 PR 冲突无意义,等待你关闭 #4935。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

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 p2 scope/wiring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model announces next step ('Running tests:') then stops without calling any tool — session stalls until user types again

2 participants