Files
windmill/backend/windmill-queue
Diego Imbert dbc80e671c fix: show wall-clock execution time for WAC roots in the UI, keep duration_ms as worker time
Reworks the workflow-as-code (WAC) execution-time fix. The earlier approach
persisted wall-clock into `v2_job_completed.duration_ms`, but that column is
read as worker *service time* by cloud-usage accounting and EE workspace
fairness — so a WAC root that suspends while its task jobs run would bill and
be throttled for idle wall-clock, and counting it any other way (e.g. excluding
it) would let arbitrary user code in the root go uncounted.

Instead, keep `duration_ms` as the worker-measured value (revert the backend
change entirely) and compute the wall-clock total in the UI from
`completed_at - started_at` for WAC roots only. WAC roots are identified by the
`_checkpoint` in `workflow_as_code_status` (present in the completed-job API
payload; AI-agent jobs populate the column but have no `_checkpoint`).

- frontend/src/lib/utils.ts: add `isWorkflowAsCodeRoot` + `jobDisplayDurationMs`
- JobStatus.svelte / JobPreview.svelte: render the WAC-aware display duration

Reverts the duration_ms/test/sqlx/ee-repo-ref changes from the prior commits so
the backend is unchanged vs main; no EE companion change is needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 15:21:40 +02:00
..