kin: KIN-ARCH-022 Рефакторинг: pm.md строка 134 + дублированное присваивание в context_builder.py
This commit is contained in:
parent
950a2251e0
commit
a46157b22b
1 changed files with 8 additions and 3 deletions
|
|
@ -1162,7 +1162,7 @@ def _execute_department_head_step(
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
ret = {
|
||||||
"success": sub_result.get("success", False),
|
"success": sub_result.get("success", False),
|
||||||
"output": json.dumps(summary, ensure_ascii=False),
|
"output": json.dumps(summary, ensure_ascii=False),
|
||||||
"cost_usd": sub_result.get("total_cost_usd", 0),
|
"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),
|
"duration_seconds": sub_result.get("total_duration_seconds", 0),
|
||||||
"last_sub_role": last_sub_role,
|
"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_tokens=total_tokens,
|
||||||
total_duration_seconds=total_duration,
|
total_duration_seconds=total_duration,
|
||||||
)
|
)
|
||||||
error_msg = f"Department {role} sub-pipeline failed"
|
blocked_reason = dept_result.get("blocked_reason") or dept_result.get("error") or f"Department {role} sub-pipeline failed"
|
||||||
models.update_task(conn, task_id, status="blocked", blocked_reason=error_msg)
|
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 {
|
return {
|
||||||
"success": False,
|
"success": False,
|
||||||
"error": error_msg,
|
"error": error_msg,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue