(docs: Iterable[Dict[str, Any]], *, write_feishu_requested: bool)
| 2849 | completed_docs: List[Dict[str, Any]] = [] |
| 2850 | errors: List[str] = [] |
| 2851 | |
| 2852 | if not selected_numbers: |
| 2853 | with _READING_TASK_LOCK: |
| 2854 | task = _READING_TASKS.get(task_id) |
| 2855 | if task: |
| 2856 | task["status"] = "completed" |
| 2857 | task["progress_phase"] = "completed" |
| 2858 | task["completed_docs"] = [] |
| 2859 | task["errors"] = [] |
| 2860 | task["completed_at"] = _task_timestamp() |
| 2861 | task["updated_at"] = task["completed_at"] |
| 2862 | return |
| 2863 | |
| 2864 | # 1) 先把所有选中的论文标记为"精读中",让前端能实时看到占位文件。 |
| 2865 | running_steps = [ |
| 2866 | "已创建精读报告占位文件。", |
| 2867 | _reading_language_notice(response_language), |
| 2868 | "正在解析 PDF;如已配置 MinerU,会优先使用 MinerU。", |
| 2869 | "正在调用 LLM 生成 Q1-Q7 精读内容。", |
| 2870 | ] |
| 2871 | for index, _number in enumerate(selected_numbers): |
| 2872 | doc = docs[index] if index < len(docs) else {} |
| 2873 | paper = doc.get("paper_raw") or doc.get("paper") or {} |
| 2874 | report_path = Path(str(doc.get("report_path") or "")) |
| 2875 | if not str(report_path): |
| 2876 | continue |
| 2877 | try: |
| 2878 | _write_reading_placeholder( |
no test coverage detected