Repository navigation
[PR] fix: thinking-then-stop — skip refetch, emit in-band error for host retry (#7410) - #7414
ranxianglei wants to merge 2 commits into
Conversation
…etry (#7410) When the model thinks but produces no answer or tool call (thinking-then-stop), refetching the same request + same nudge degenerates again 41% of the time (measured). This change skips the refetch and hands the turn back to the host as a retryable in-band error (same frame shape as the exhausted-retry path). The first attempt's thinking block is the complete visible output, so no second thinking block is appended. Closes #7410
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11105-pr.7414.a76b4beThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7414.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…#7410) The error message is shown verbatim in the host UI. The mechanism explanation (not refetching, handing back to host for retry) belongs in the log, not in the user-facing error. Shortened to 'the turn degenerated (thinking-then-stop)' per reviewer feedback.
[bot] 🏷 PR #7414 审核 — thinking-then-stop 跳过 refetch,直接 in-band error 交宿主重试 查重:不重复。这是 #7410 的修复 PR,无其他在途 PR 针对同一主题(已搜 open PR,只有 #7414 匹配 "thinking-then-stop" / "7410")。 审核结论(八问):
验证情况:
判定:PR 可合并。修法合理(疏而非堵——从源头跳过无意义的 refetch,而非在下游过滤拼接的块),测试有效(有牙齿,断言 |
问题
DSH 车道上,模型「思考完就停、不给正文」(thinking-then-stop)时,proxy 会 refetch 一次。实测 refetch 后 41% 仍然退化(46 次 nudge 里 19 次 degenerate-again),既慢又费 token。
修法
thinking-then-stop 不再 refetch,直接发 in-band error 交回宿主重试(和 exhausted-retry 路径同一个 frame shape)。第一次的 thinking block 是完整的可见输出,所以不会出现第二个 thinking block。
行为变更
宿主(DSH)本来就配了 5 次重试(
retryableCodes含EMPTY_RESPONSE/MALFORMED_RESPONSE),in-band error 会触发宿主重试。所以这个变更只是把「白跑一次 + 报错」换成「直接交给能兜底的」。测试
新增
tests/plugin-empty-turn-retry.test.ts里的plugin chat (anthropic) thinking-then-stop: no refetch, in-band error for host retry测试,验证:calls === 0(不 refetch)event: error+"code":"stream_error"+thinking-then-stopthinking-then-stop+not refetchingCloses #7410