fix(analysis): 骨架生成assignee_role与section一致(商务章→bid_biz_writer)+显式chapters也走_infer_section

This commit is contained in:
yumoqing 2026-08-31 15:54:15 +08:00
parent 35aabc2acc
commit 8a13da7322

View File

@ -516,15 +516,16 @@ async def create_chapter_outline(project_id, chapters="", who=None, agent_id=Non
if (tgt and tgt == cno) or (nm and (nm in title or title in nm)):
matched.append(s["id"])
msum += to_float(s.get("max_score"), 0.0)
sec = str(it.get("section") or _infer_section(title) or "technical")[:30]
await sor.C("bid_chapters", {
"id": new_id(), "project_id": project_id,
"chapter_no": cno, "parent_no": str(it.get("parent_no") or "")[:30],
"title": title, "section": str(it.get("section") or "technical")[:30],
"title": title, "section": sec,
"scoring_item_ids": json.dumps(matched, ensure_ascii=False),
"outline": str(it.get("outline") or "")[:20000],
"status": CH_PENDING, "version": 1, "revise_count": 0,
"max_score": msum or None,
"assignee_role": "agent.bid_writer",
"assignee_role": "agent.bid_biz_writer" if sec == "business" else "agent.bid_writer",
"order_no": idx + 1,
})
created += 1