fix successful steps count (#1457)

This commit is contained in:
Shuchang Zheng 2024-12-31 12:27:35 -08:00 committed by GitHub
parent 171aef6bf7
commit 8c08edfb78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -836,7 +836,7 @@ class WorkflowService:
total_steps = len(workflow_run_steps)
# TODO: This is a temporary cost calculation. We need to implement a more accurate cost calculation.
# successful steps are the ones that have a status of completed and the total count of unique step.order
successful_steps = set(step.order for step in workflow_run_steps if step.status == StepStatus.completed)
successful_steps = [step for step in workflow_run_steps if step.status == StepStatus.completed]
total_cost = 0.1 * len(successful_steps)
return WorkflowRunStatusResponse(
workflow_id=workflow.workflow_permanent_id,