From 27eb3db77237ffc6a087a1d86cf8655440aa3f3a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 15 Sep 2026 16:45:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(bidding):=20create=5Fhuman=5Ftask=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=8A=B6=E6=80=81=E9=97=A8=E7=A6=81=E2=80=94=E2=80=94?= =?UTF-8?q?=E5=B7=B2=E5=88=A0=E9=99=A4/paused/archived/cancelled/completed?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=8D=E5=8F=91=E6=96=B0=E5=BE=85=E5=8A=9E?= =?UTF-8?q?(=E4=B8=8E=E5=BC=95=E6=93=8E=E5=90=8C=E6=AC=BE,2026-09-15?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=8C=87=E4=BB=A4:=E6=9A=82=E5=81=9C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9A=84=E9=A1=B9=E7=9B=AE=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E4=BA=A7=E7=94=9F=E5=BE=85=E5=8A=9E,=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E6=8E=A8=E8=BF=9B=E5=90=8E=E5=AF=B9=E8=B4=A6=E5=99=A8=E6=8C=89?= =?UTF-8?q?=E9=9C=80=E8=A1=A5=E5=8F=91)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_bidding/bid_common.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pipeline_bidding/bid_common.py b/pipeline_bidding/bid_common.py index d2cc18c..2ec4bee 100644 --- a/pipeline_bidding/bid_common.py +++ b/pipeline_bidding/bid_common.py @@ -371,7 +371,23 @@ async def create_human_task(sor, project_id, task_type, title, description="", 同一事项只发一次待办(2026-09-01 机制层不变量):同项目+同类型已有 pending 任务 → 直接返回已有 id,不重复创建。防止对账器/agent 每轮 重复发同类待办把用户淹没。 + + 项目状态门禁(2026-09-15,与引擎 create_human_task 同款):项目已删除或 + 处于 paused/archived/cancelled/completed → 不发新待办返回 ''(暂停/删除的 + 项目不再产生待办;恢复推进后对账器按需补发)。 """ + prec = await sor.sqlExe( + "SELECT status FROM sd_projects WHERE id=${p}$", {"p": project_id or ""}) + await sor.sqlExe("COMMIT", {}) + if not prec: + logger.info("bid create_human_task skipped: project %s deleted (type=%s)", + project_id, task_type) + return "" + _st = getattr(prec[0], "status", "") or "" + if _st in ("paused", "archived", "cancelled", "completed"): + logger.info("bid create_human_task skipped: project %s status=%s (type=%s)", + project_id, _st, task_type) + return "" exist = await find_human_task(sor, project_id, task_type, status="pending") if exist: logger.info("bid create_human_task dedup: type=%s existing=%s project=%s",