Skip to content

Commit 280cc67

Browse files
Novice LeeNovice Lee
Novice Lee
authored and
Novice Lee
committed
fix: Add missing information for step-by-step debugging
1 parent 204d314 commit 280cc67

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

api/core/workflow/nodes/event/event.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,9 @@ class RunRetryEvent(BaseModel):
3939
start_at: datetime = Field(..., description="Retry start time")
4040

4141

42-
class SingleStepRetryEvent(BaseModel):
42+
class SingleStepRetryEvent(NodeRunResult):
4343
"""Single step retry event"""
4444

4545
status: str = WorkflowNodeExecutionStatus.RETRY.value
4646

47-
inputs: dict | None = Field(..., description="input")
48-
error: str = Field(..., description="error")
49-
outputs: dict | None = Field(..., description="output")
50-
retry_index: int = Field(..., description="Retry attempt number")
51-
error: str = Field(..., description="error")
5247
elapsed_time: float = Field(..., description="elapsed time")
53-
execution_metadata: dict | None = Field(..., description="execution metadata")

api/fields/workflow_run_fields.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,15 @@
8282
}
8383

8484
retry_event_field = {
85-
"error": fields.String,
86-
"retry_index": fields.Integer,
87-
"inputs": fields.Raw(attribute="inputs"),
8885
"elapsed_time": fields.Float,
89-
"execution_metadata": fields.Raw(attribute="execution_metadata_dict"),
9086
"status": fields.String,
87+
"inputs": fields.Raw(attribute="inputs"),
88+
"process_data": fields.Raw(attribute="process_data"),
9189
"outputs": fields.Raw(attribute="outputs"),
90+
"metadata": fields.Raw(attribute="metadata"),
91+
"llm_usage": fields.Raw(attribute="llm_usage"),
92+
"error": fields.String,
93+
"retry_index": fields.Integer,
9294
}
9395

9496

api/services/workflow_service.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -268,18 +268,14 @@ def run_draft_workflow_node(
268268
node_run_result.retry_index = retries
269269
retry_events.append(
270270
SingleStepRetryEvent(
271-
inputs=WorkflowEntry.handle_special_values(node_run_result.inputs)
272-
if node_run_result.inputs
273-
else None,
271+
elapsed_time=time.perf_counter() - retry_start_at,
272+
inputs=WorkflowEntry.handle_special_values(node_run_result.inputs),
273+
process_data=WorkflowEntry.handle_special_values(node_run_result.process_data),
274+
outputs=WorkflowEntry.handle_special_values(node_run_result.outputs),
275+
metadata=node_run_result.metadata,
276+
llm_usage=node_run_result.llm_usage,
274277
error=node_run_result.error,
275-
outputs=WorkflowEntry.handle_special_values(node_run_result.outputs)
276-
if node_run_result.outputs
277-
else None,
278278
retry_index=node_run_result.retry_index,
279-
elapsed_time=time.perf_counter() - retry_start_at,
280-
execution_metadata=WorkflowEntry.handle_special_values(node_run_result.metadata)
281-
if node_run_result.metadata
282-
else None,
283279
)
284280
)
285281
time.sleep(retry_interval)

0 commit comments

Comments
 (0)