From 4d543f529c38609bba16a956a0c12d81450ca791 Mon Sep 17 00:00:00 2001 From: ymq Date: Wed, 19 Aug 2026 18:34:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(qa-feedback):=20raise=5Fproblem=20=E5=BD=92?= =?UTF-8?q?=E4=B8=80=E5=8C=96=20question=EF=BC=8C=E4=BF=AE=E5=A4=8D=20QC?= =?UTF-8?q?=20=E6=94=B9=E8=BF=9B=E6=84=8F=E8=A7=81=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=EF=BC=881241=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:QC 审核的决策里 questions 是 list(7 条改进意见数组),qc_review_run 把 decision.get("questions") 直接传给 raise_problem 的 question 参数,而 raise_problem 未做 str 化,导致 INSERT pipeline_agent_questions 时 question 字段是 list,MySQL 报 OperationalError(1241, 'Operand should contain 1 column(s)'),改进意见根本没落库。 后果链:QC 意见丢失 → develop 重做时 _build_qna_section 读不到任何 pending 退回意见 → 每次裸重做(看不到「为什么被驳回、该怎么改」)→ 反复产出同样的空交付件。 修复:raise_problem 里 question 若为 list/tuple,先 join 成换行字符串再入库。 --- pipeline_service/communication.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pipeline_service/communication.py b/pipeline_service/communication.py index a48c10c..34597fe 100644 --- a/pipeline_service/communication.py +++ b/pipeline_service/communication.py @@ -56,6 +56,11 @@ async def raise_problem(problem_type, question, from_role, from_agentid="", question_id """ db, dbname = _get_db() + # 归一化 question:QC 决策的 questions 可能是 list(多条意见数组),须 join 成字符串, + # 否则 INSERT 报 OperationalError(1241, 'Operand should contain 1 column(s)'),改进意见丢失、 + # develop 重做时读不到任何退回意见 → 反复产出空交付件。 + if isinstance(question, (list, tuple)): + question = "\n".join(str(x) for x in question) async with db.sqlorContext(dbname) as sor: hr = first_handler_role or "agent.main_agent" ha = first_handler_agentid or ""