修复中途退出比价的 LLM 成本回填 #191
Reference in New Issue
Block a user
Delete Branch "codex/comparison-cancelled-llm-cost"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
比价记录进入中途退出后未触发 LLM 成本回填,周期补偿也未扫描 cancelled,导致实际已有 LLM 调用的记录长期显示成本、LLM、TOKEN 为空。
修改
验证
🤖 review-pr 深审结论
🟢 看着没问题,已实跑验证(后端 pytest 15 项通过)。 置信度 0.9。
正面
BackgroundTasks(compare.py:28)与backfill_comparison_llm_cost(compare.py:39)均已 import,无 NameError;与trace_epilogue已有的 done 路径同款写法,一致。_harvest_abort_blocking返回rec.id供后台任务回填;repair 批量同步加入cancelled,与实时回填口径一致;测试覆盖完整。说明(low)
record_id守卫、且镜像既有 done 路径行为,风险低。