task v2 doesn't have failure_reason (#2760)
Some checks are pending
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run

This commit is contained in:
Shuchang Zheng 2025-06-21 04:42:05 +08:00 committed by GitHub
parent 5bd2cabae4
commit 592ed941ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2558,7 +2558,12 @@ class TaskV2Block(Block):
# Determine block status from task status using module-level mapping
block_status = TASKV2_TO_BLOCK_STATUS.get(task_v2.status, BlockStatus.failed)
success = task_v2.status == TaskV2Status.completed
failure_reason = task_v2.failure_reason
failure_reason: str | None = None
task_v2_workflow_run_id = task_v2.workflow_run_id
if task_v2_workflow_run_id:
task_v2_workflow_run = await app.DATABASE.get_workflow_run(task_v2_workflow_run_id, organization_id)
if task_v2_workflow_run:
failure_reason = task_v2_workflow_run.failure_reason
# If continue_on_failure is True, we treat the block as successful even if the task failed
# This allows the workflow to continue execution despite this block's failure