diff --git a/pipeline_service/human_task_capability.py b/pipeline_service/human_task_capability.py index c30b9f2..ff883c4 100644 --- a/pipeline_service/human_task_capability.py +++ b/pipeline_service/human_task_capability.py @@ -284,31 +284,18 @@ async def complete_human_task(human_task_id, result_data, operator_id=None): if task_type == T_BUG_ACCEPT: return False, "bug 验收任务请走 bug_accept 接口" - # general:done + 触发 QC(创建 qc_review 任务) + # 2026-09-15 用户裁定(人类答复权威):人类待办的答复不再送 agent QC。 + # 原链路 complete→human_task_qc→通用QC提示词审查人类答复→LLM 判「答复不合规」 + # →qc_reject→待办回 pending→用户再说「忽略」又被退——实测甘肃项目用户答复 + # 「忽略任这些问题」被连退(45EbV3Nw 一个待办堆了 3 个 QC 任务)。 + # 待办的本质是「请人类办事」,人类说完成/忽略 = 最终裁定,agent 审查人类是倒挂; + # 与「人工 override 权威守卫须跳过」铁律一致(确定性规则,不靠 LLM 自觉)。 await sor.sqlExe( "UPDATE pipeline_human_tasks SET status='done', result_data=${rd}$, " + "qc_status='passed', qc_comment='人类答复即权威(不送agent QC)', " "submitted_by=${oid}$, submitted_at=NOW() WHERE id=${hid}$", {"rd": result_json, "oid": operator_id, "hid": human_task_id}) await sor.sqlExe("COMMIT", {}) - - # 创建 QC 任务(复用 qc poller → qc_review_run) - qid = getID() - qparams = { - "task_kind": "human_task_qc", - "human_task_id": human_task_id, - "title": ht.get('title', '') or '', - "description": (ht.get('description', '') or '')[:2000], - "iteration_id": ht.get('iteration_id', '') or '', - } - # 补 title(pipeline_human_tasks 有 title 列,已在上方 result 里带) - await sor.C('pipeline_tasks', { - 'id': qid, 'tenant_id': pid, 'pipeline_id': 'role_task', - 'owner_id': 'human_task_qc', - 'title': f"人类任务 QC 检查({human_task_id[:8]})", - 'state': 'qc_review', 'role': 'agent.qc', - 'params': json.dumps(qparams, ensure_ascii=False), - }) - await sor.sqlExe("COMMIT", {}) return True, human_task_id