feat:优化节点错误处理
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user