feat:优化节点错误处理

This commit is contained in:
2026-09-29 08:17:58 -07:00
parent 352d144823
commit 6a38a5f15e
8 changed files with 113 additions and 50 deletions
+3 -4
View File
@@ -101,16 +101,15 @@ class AgentService:
@staticmethod
def _result(state, thread_id):
waiting = bool(state.get("__interrupt__"))
# 只交付校验通过的完整动作批次,失败草稿留在后端
deliver = state["status"] == "completed" and state.get("validation_passed")
return AgentResult(
conversation_id=state["conversation_id"],
thread_id=thread_id,
message_id=state["message_id"],
status="waiting_for_input" if waiting else state["status"],
actions=state.get("actions") or []
if state.get("validation_passed") is True and state["status"] == "completed"
else [],
actions=state["actions"] if deliver else [],
answer=state.get("answer"),
clarification=state.get("clarification") if waiting else None,
failure_reason=state.get("failure_reason"),