fix: bypass pipeline_submit, create tasks directly in cockpit

This commit is contained in:
yumoqing 2026-08-02 17:56:06 +08:00
parent 40afce18e7
commit 28820a0b29

View File

@ -358,14 +358,15 @@ if action == 'send_message':
title = intent.get('title', '') or message_text[:100]
task_params = {'description': intent.get('description', ''), 'input_text': message_text}
try:
result = await pipeline_submit(org_id, 'sdlc_general', uid, title, task_params)
rd = json.loads(result)
if rd.get('success'):
task_id = rd.get('task_id', '')
# Direct task creation (bypass pipeline_submit to avoid executor issues)
task_id = getID()
await sor.C('pipeline_tasks', {
'id': task_id, 'tenant_id': org_id, 'pipeline_id': 'sdlc_general',
'owner_id': uid, 'title': title, 'state': 'submitted',
'params': json.dumps(task_params, ensure_ascii=False)
})
await _save_context(sor, uid, pid, iid)
agent_reply = f"✅ 任务「{title}」已提交({task_id}),产线开始执行。"
else:
agent_reply = f"任务提交失败:{rd.get('message', '未知错误')}"
agent_reply = f"✅ 任务「{title}」已提交({task_id})。"
except Exception as e:
agent_reply = f"任务提交失败:{str(e)[:200]}"
elif intent_type == 'add_bug':