( runId: string, error: string, rootDir?: string, nowMs?: number, )
| 739 | } |
| 740 | |
| 741 | export async function markAutonomyRunFailed( |
| 742 | runId: string, |
| 743 | error: string, |
| 744 | rootDir?: string, |
| 745 | nowMs?: number, |
| 746 | ): Promise<AutonomyRunRecord | null> { |
| 747 | const endedAt = nowMs ?? Date.now() |
| 748 | const updated = await updateAutonomyRun( |
| 749 | runId, |
| 750 | current => |
| 751 | isActiveAutonomyRunStatus(current.status) |
| 752 | ? failAutonomyRunRecord(current, error, endedAt) |
| 753 | : null, |
| 754 | rootDir, |
| 755 | ) |
| 756 | if (updated) { |
| 757 | await syncFailedManagedFlowForRun(updated, rootDir ?? updated.rootDir) |
| 758 | } |
| 759 | return updated |
| 760 | } |
| 761 | |
| 762 | export async function markAutonomyRunCancelled( |
| 763 | runId: string, |
no test coverage detected