fix(idle): 补偿触发 bug + 存量回填脚本 - #53
Merged
Merged
Conversation
发现 idle 补偿触发 bug:Critical #6 的 _compensate_stuck_skimmed 此前 挂在 _process_batch 末尾,但无 unread 论文时 _process_batch 提前 return 0(line 225-227),补偿永远不触发。库里 1239 篇卡在 skimmed 未精读(有 summary_md 但 deep_dive_md 空),idle_processor 反复报 "没有需要处理的未读论文"却从不补偿,stuck 论文永久卡死。 修复: - packages/ai/idle_processor.py:把 _compensate_stuck_skimmed 调用从 _process_batch 末尾移到 _run_loop,独立于 skim 批次触发。无论有无 unread 论文,每次 idle 检查都尝试补偿 stuck 论文。_process_batch 只负责 skim,补偿在循环层独立调用。 回填脚本: - scripts/redeep_stuck_skimmed.py:一次性回填存量 stuck 论文。按 skim_score 降序优先精读高价值论文(1233 篇高分>=0.8),支持 --dry-run/--limit/--min-score/--concurrency。deep_dive 幂等覆盖, 重跑安全。 测试:新增 TestIdleCompensationTrigger 2 项(_process_batch 无 unread 返回0且不调补偿、补偿独立捞 stuck 论文),全套 63 passed。
🔍 OpenCode PR Review Required这是一个受保护的分支,merge 前需要进行 code review。 请运行以下命令进行 OpenCode review: 或者在 PR 页面评论 This is an automated reminder from PR Review Gate. |
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.
Bug:idle 补偿永远不触发
发现 Critical #6 的
_compensate_stuck_skimmed此前挂在_process_batch末尾,但无 unread 论文时_process_batch提前return 0(idle_processor.py:225-227),补偿永远不触发。服务器实测:库里 1239 篇卡在 skimmed 未精读(有 summary_md 但 deep_dive_md 空,其中 1233 篇高分 >=0.8),idle_processor 反复报"没有需要处理的未读论文"却从不补偿,stuck 论文永久卡死。
修复
packages/ai/idle_processor.py:把_compensate_stuck_skimmed调用从_process_batch末尾移到_run_loop,独立于 skim 批次触发。无论有无 unread 论文,每次 idle 检查都尝试补偿 stuck 论文。_process_batch只负责 skim,补偿在循环层独立调用。存量回填
scripts/redeep_stuck_skimmed.py:一次性回填存量 stuck 论文。按skim_score降序优先精读高价值论文,支持--dry-run/--limit/--min-score/--concurrency。deep_dive幂等覆盖,重跑安全。部署后在服务器跑一次回填。验证
_process_batch无 unread 返回0且不调补偿、补偿独立捞 stuck 论文)部署影响
python scripts/redeep_stuck_skimmed.py(建议先 --limit 100 试跑)