From ae213b2f9127a48343c9e647dfee23a8c0340f4c Mon Sep 17 00:00:00 2001 From: ymq Date: Wed, 2 Sep 2026 11:07:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=9B=B6=E6=B6=88=E8=80=97):=20paused?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=A4=E4=B8=AAtokens=E6=BC=8F=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - failed_poller→handle_failed_task: paused项目跳过LLM决策(原每轮白烧) - bug_poller→pm_bug_confirm_run: JOIN sd_projects排除paused(原只看迭代状态) 三主poller(role/pm/qc)已排除paused;retrospective由pm_poller触发无漏点 --- pipeline_service/agent_loop.py | 7 +++++++ pipeline_service/bug_flow.py | 3 +++ 2 files changed, 10 insertions(+) diff --git a/pipeline_service/agent_loop.py b/pipeline_service/agent_loop.py index 8c794b4..77f3072 100644 --- a/pipeline_service/agent_loop.py +++ b/pipeline_service/agent_loop.py @@ -3479,6 +3479,13 @@ async def handle_failed_task(task_id: str, project_id: str) -> dict: # 释放 SELECT 的元数据锁,防止连接回池后阻塞 DDL await sor.sqlExe("COMMIT", {}) return {"status": "idle", "task_id": task_id} + # paused 项目零消耗(2026-09-02):暂停 = 完全停摆,失败任务不判定不重跑, + # 直接跳过(本函数后续有 LLM 决策调用,paused 项目每轮白烧 tokens)。 + _p = await sor.sqlExe( + "SELECT status FROM sd_projects WHERE id=${pid}$", {"pid": project_id}) + await sor.sqlExe("COMMIT", {}) + if _p and getattr(_p[0], "status", "") == "paused": + return {"status": "skipped_paused", "task_id": task_id} t = recs[0] title = getattr(t, "title", "") or "" role = getattr(t, "role", "") or "" diff --git a/pipeline_service/bug_flow.py b/pipeline_service/bug_flow.py index f62f6c0..a3ee743 100644 --- a/pipeline_service/bug_flow.py +++ b/pipeline_service/bug_flow.py @@ -414,9 +414,12 @@ async def bug_flow_poll_once(db): """一轮完整的 bug 循环:PM 确认 open + 确定性流转(verified/fixed/confirmed)。""" async with db.sqlorContext("pipeline") as sor: # 1) open → PM 独立确认(按项目分组,只对有 open bug 的项目触发) + # paused 项目零消耗(2026-09-02):暂停 = 完全停摆,open bug 不触发 + # PM LLM 确认(每轮白烧 tokens),恢复推进后下一轮自动继续确认。 proj_rows = await sor.sqlExe( "SELECT DISTINCT i.project_id FROM sd_bugs b " "JOIN sd_iterations i ON b.iteration_id=i.id " + "JOIN sd_projects p ON p.id=i.project_id AND p.status != 'paused' " "WHERE b.status='open' AND i.status='in_progress' LIMIT 20", {}) await sor.sqlExe("COMMIT", {}) confirm_sum = {"confirmed": 0, "rejected": 0, "skipped": 0}