diff --git a/agents/runner.py b/agents/runner.py index f099a6f..763be3e 100644 --- a/agents/runner.py +++ b/agents/runner.py @@ -1162,7 +1162,7 @@ def _execute_department_head_step( }, } - ret = { + return { "success": sub_result.get("success", False), "output": json.dumps(summary, ensure_ascii=False), "cost_usd": sub_result.get("total_cost_usd", 0), @@ -1170,10 +1170,6 @@ 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 # --------------------------------------------------------------------------- @@ -1589,9 +1585,8 @@ def run_pipeline( total_tokens=total_tokens, total_duration_seconds=total_duration, ) - 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) + error_msg = f"Department {role} sub-pipeline failed" + models.update_task(conn, task_id, status="blocked", blocked_reason=error_msg) return { "success": False, "error": error_msg,