From a46157b22b3309e66eed9856bea22766e3d86e4d Mon Sep 17 00:00:00 2001 From: Gros Frumos Date: Tue, 17 Mar 2026 16:03:49 +0200 Subject: [PATCH] =?UTF-8?q?kin:=20KIN-ARCH-022=20=D0=A0=D0=B5=D1=84=D0=B0?= =?UTF-8?q?=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=BD=D0=B3:=20pm.md=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=BA=D0=B0=20134=20+=20=D0=B4=D1=83=D0=B1?= =?UTF-8?q?=D0=BB=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D0=BE=D0=B5=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D1=81=D0=B2=D0=B0=D0=B8=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B2=20context=5Fbuilder.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agents/runner.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/agents/runner.py b/agents/runner.py index 763be3e..f099a6f 100644 --- a/agents/runner.py +++ b/agents/runner.py @@ -1162,7 +1162,7 @@ def _execute_department_head_step( }, } - return { + ret = { "success": sub_result.get("success", False), "output": json.dumps(summary, ensure_ascii=False), "cost_usd": sub_result.get("total_cost_usd", 0), @@ -1170,6 +1170,10 @@ def _execute_department_head_step( "duration_seconds": sub_result.get("total_duration_seconds", 0), "last_sub_role": last_sub_role, } + if not sub_result.get("success"): + ret["blocked_reason"] = sub_result.get("blocked_reason") or sub_result.get("error") + ret["error"] = sub_result.get("error") + return ret # --------------------------------------------------------------------------- @@ -1585,8 +1589,9 @@ def run_pipeline( total_tokens=total_tokens, total_duration_seconds=total_duration, ) - error_msg = f"Department {role} sub-pipeline failed" - models.update_task(conn, task_id, status="blocked", blocked_reason=error_msg) + blocked_reason = dept_result.get("blocked_reason") or dept_result.get("error") or f"Department {role} sub-pipeline failed" + error_msg = f"Department {role} sub-pipeline failed: {dept_result.get('output', '')[:200]}" + models.update_task(conn, task_id, status="blocked", blocked_reason=blocked_reason) return { "success": False, "error": error_msg,