mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-18 18:35:54 +08:00
fix: incorrect use of node execution id
This commit is contained in:
parent
9a6f120e5c
commit
63206a7967
@ -287,12 +287,12 @@ class WorkflowCycleManage:
|
||||
process_data = WorkflowEntry.handle_special_values(event.process_data)
|
||||
outputs = WorkflowEntry.handle_special_values(event.outputs)
|
||||
execution_metadata_dict = event.execution_metadata
|
||||
if self._wip_workflow_agent_logs.get(event.node_execution_id):
|
||||
if self._wip_workflow_agent_logs.get(workflow_node_execution.id):
|
||||
if not execution_metadata_dict:
|
||||
execution_metadata_dict = {}
|
||||
|
||||
execution_metadata_dict[NodeRunMetadataKey.AGENT_LOG] = self._wip_workflow_agent_logs.get(
|
||||
event.node_execution_id, []
|
||||
workflow_node_execution.id, []
|
||||
)
|
||||
|
||||
execution_metadata = json.dumps(jsonable_encoder(execution_metadata_dict)) if execution_metadata_dict else None
|
||||
@ -343,12 +343,12 @@ class WorkflowCycleManage:
|
||||
finished_at = datetime.now(UTC).replace(tzinfo=None)
|
||||
elapsed_time = (finished_at - event.start_at).total_seconds()
|
||||
execution_metadata_dict = event.execution_metadata
|
||||
if self._wip_workflow_agent_logs.get(event.node_execution_id):
|
||||
if self._wip_workflow_agent_logs.get(workflow_node_execution.id):
|
||||
if not execution_metadata_dict:
|
||||
execution_metadata_dict = {}
|
||||
|
||||
execution_metadata_dict[NodeRunMetadataKey.AGENT_LOG] = self._wip_workflow_agent_logs.get(
|
||||
event.node_execution_id, []
|
||||
workflow_node_execution.id, []
|
||||
)
|
||||
|
||||
execution_metadata = json.dumps(jsonable_encoder(execution_metadata_dict)) if execution_metadata_dict else None
|
||||
|
@ -56,17 +56,6 @@ class ToolNode(BaseNode[ToolNodeData]):
|
||||
"plugin_unique_identifier": node_data.plugin_unique_identifier,
|
||||
}
|
||||
|
||||
yield AgentLogEvent(
|
||||
id=self.node_id,
|
||||
node_execution_id=self.id,
|
||||
parent_id=None,
|
||||
error=None,
|
||||
status="running",
|
||||
data={
|
||||
"tool_info": tool_info,
|
||||
},
|
||||
)
|
||||
|
||||
# get tool runtime
|
||||
try:
|
||||
tool_runtime = ToolManager.get_workflow_tool_runtime(
|
||||
@ -289,6 +278,16 @@ class ToolNode(BaseNode[ToolNodeData]):
|
||||
elif message.type == ToolInvokeMessage.MessageType.FILE:
|
||||
assert message.meta is not None
|
||||
files.append(message.meta["file"])
|
||||
elif message.type == ToolInvokeMessage.MessageType.LOG:
|
||||
assert isinstance(message.message, ToolInvokeMessage.LogMessage)
|
||||
yield AgentLogEvent(
|
||||
id=message.message.id,
|
||||
node_execution_id=self.id,
|
||||
parent_id=message.message.parent_id,
|
||||
error=message.message.error,
|
||||
status=message.message.status.value,
|
||||
data=message.message.data,
|
||||
)
|
||||
|
||||
yield RunCompletedEvent(
|
||||
run_result=NodeRunResult(
|
||||
|
Loading…
x
Reference in New Issue
Block a user