Repository navigation
修复总结空响应无重试 + 新增 /api/resummarize 总结层独立重跑入口 - #26
Merged
Merged
Conversation
思考模型(如 deepseek-v4-pro)偶发返回 HTTP 200 但 content 为空串 (多因思考预算耗尽,生产已发生两次),此前 text 模式是三种输出模式 中唯一无重试的路径,空响应直接落终态 FAILED。 - _call_with_text_output 增加空 content 重发循环,次数读 llm.text_output.max_retries(默认 2) - 第 2 次尝试起强制 reasoning_effort=disabled(原样重发大概率复发) - 每次尝试都记录审计用量;耗尽仍空返回空串,行为与现状一致
此前总结失败后唯一重试路径是「重新校对」,要为补一层而重付整条 校对管线成本(镜像 recalibrate 全套骨架:权限/归属校验/inflight 登记/队列收口),但 processing_options 固定为只跑总结层: - 复用缓存 llm_calibrated 作为总结输入,transcription_data=None 避免二次说话人推断,cached_speaker_count 从结构化产物回传 - 校对层/章节层文件与状态均不动(_save_llm_results 现有合并语义) - 总结已存在且状态 generated 时 400,防止误点重复消耗 - 前端总结失败区块改为内联「重新生成总结」按钮,不再指向重新校对
|
Reviewed commit: 🤖 Review 门禁 — 判定:
|
📒 Review ledger state
完整数据保存在 |
zj1123581321
added a commit
that referenced
this pull request
Oct 15, 2026
修复总结空响应无重试 + 新增 /api/resummarize 总结层独立重跑入口
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
生产事故(n305, 2026-07-21,另有 2026-07-09 一次同款):总结模型 deepseek-v4-pro(思考模型)返回 HTTP 200、2383 completion tokens,但
message.content为空串,总结被判 FAILED。排查确认两个问题同根:失败处理的最小单位是整条管线而不是层。改动
1. text 模式空响应重试(降低失败率)
思考模型偶发返回 200 但 content 为空(多因思考预算耗尽),此前 text 模式是三种输出模式(text / json_object / json_schema)中唯一零重试的路径。
_call_with_text_output新增空 content 重发循环,次数读llm.text_output.max_retries(默认 2,配置键已加入 config.example.jsonc)reasoning_effort=disabled(证据表明空响应多因思考预算耗尽,原样重发大概率复发)2. /api/resummarize 层粒度重跑入口(降低失败成本)
此前总结失败后唯一重试路径是「重新校对」,要为补一层而重付整条校对管线成本(事故任务 2.4 万字)。
POST /api/resummarize,镜像 recalibrate 全套骨架(复用recalibrate权限名、归属校验 fail-closed、inflight 登记、队列收口)processing_options固定{calibrate: false, summarize: true, infer_speaker_names: false, chapters: false}:复用缓存llm_calibrated作为总结输入,transcription_data=None避免二次说话人推断,cached_speaker_count从结构化产物回传;_handle_llm_task/_save_llm_results/coordinator 零改动(现有标志组合天然支持)测试
tests/unit/test_llm_text_retry.py(5 例)、tests/unit/test_resummarize.py(9 例)、tests/integration/test_llm_ops_resummarize.py(断言总结写入且校对层文件/mtime/状态不动)make test(CI 同命令)exit 0;tests/unit全量 2490 passedtests/integration/test_layered_cache.py有 20 个失败,已用 pristine HEAD git worktree 复跑确认为本环境预置失败,与本 PR 无关部署备注
合并后走常规
./docker/push_to_ghcr.sh流程;生产 n305 的 config 无需变更(text_output.max_retries缺省即默认 2)。部署后 2026-07-21 失败的小宇宙 EP44 任务可用新按钮直接补出总结。