Improve workflow error messaging

This commit is contained in:
2026-03-09 23:51:37 -04:00
parent fa2de3e259
commit f2c25fb9c6
11 changed files with 272 additions and 41 deletions

View File

@@ -8,7 +8,7 @@ import type {
export type StageTimelineItem = {
stage: TaskStage;
label: string;
state: 'completed' | 'active' | 'pending';
state: 'completed' | 'active' | 'pending' | 'failed';
detail: string | null;
timestamp: string | null;
context: Task['stage_context'] | null;
@@ -203,7 +203,7 @@ export function buildStageTimeline(task: Task, events: TaskStageEvent[]): StageT
return {
stage,
label: stageLabel(stage),
state: 'completed' as const,
state: task.status === 'failed' && stage === task.stage ? 'failed' as const : 'completed' as const,
detail: event?.stage_detail ?? task.stage_detail,
timestamp: event?.created_at ?? task.finished_at,
context: event?.stage_context ?? (stage === task.stage ? task.stage_context : null) ?? null