From f519f48dd5e4066eac53136ce5dcfa3fa17bce92 Mon Sep 17 00:00:00 2001 From: ymq Date: Sat, 15 Aug 2026 00:11:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20cockpit=20v1=20answer=5Fquestion=20?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E5=90=8E=E6=81=A2=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=20waiting=E2=86=92submitted=EF=BC=88=E6=B8=85=20claimed=5Fby?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/cockpit_chat.dspy | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wwwroot/api/cockpit_chat.dspy b/wwwroot/api/cockpit_chat.dspy index 5367cd4..ec9b926 100644 --- a/wwwroot/api/cockpit_chat.dspy +++ b/wwwroot/api/cockpit_chat.dspy @@ -396,10 +396,13 @@ async def _exec_tool(sor, tool, params, ctx, uid, org_id): ans = p.get('answer','') if not qid: return 'FAIL: 需要问题ID' if not ans: return 'FAIL: 需要回答内容' - qs = await sor.sqlExe("SELECT id,status FROM pipeline_agent_questions WHERE id=${q}$",{"q":qid}) + qs = await sor.sqlExe("SELECT id,task_id FROM pipeline_agent_questions WHERE id=${q}$",{"q":qid}) if not qs: return 'FAIL: 问题不存在' - await sor.sqlExe("UPDATE pipeline_agent_questions SET answer=${a}$, status='answered', answered_at=NOW() WHERE id=${q}$",{"a":ans,"q":qid}) - return f'OK: 已回答' + await sor.sqlExe("UPDATE pipeline_agent_questions SET answer=${a}$, answer_source='main_agent', answered_by='main_agent', status='answered' WHERE id=${q}$",{"a":ans,"q":qid}) + tid = getattr(qs[0],'task_id','') or '' + if tid: + await sor.sqlExe("UPDATE pipeline_tasks SET state='submitted', claimed_by=NULL WHERE id=${t}$ AND state='waiting'",{"t":tid}) + return 'OK: 已回答' + (',任务已恢复执行' if tid else '') elif tool == 'start_agents': if not ctx['pid']: return 'FAIL: 请先切换到项目' from pipeline_service.agent_loop import role_agent_run, pm_review_run