Skip to content

Commit 364d1f4

Browse files
authored
chore(api): describe the settled-pause rule in the run status overlay TSDoc (#9957)
1 parent 4003d19 commit 364d1f4

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

‎apps/sim/lib/api/contracts/v2/logs.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ const v2LogDetailCostSchema = z
8686
*
8787
* That pass-through is also why this field disagrees with the run resources for the
8888
* same run, and the disagreement is documented rather than reconciled. The run list
89-
* projects `paused` over the persisted value whenever the run holds a `paused` or
90-
* `partially_resumed` row in `paused_executions` (`executionStatus` in
91-
* `lib/workflows/executor/execution-queries.ts`), so an ordinary human-in-the-loop
89+
* projects `paused` over the persisted value while the run holds a `paused` or
90+
* `partially_resumed` row in `paused_executions` with a point still to resume
91+
* (`executionStatus` in `lib/workflows/executor/execution-queries.ts`), so an ordinary human-in-the-loop
9292
* pause reads `paused` there and `pending` here. Adopting the overlay would need this
9393
* read to join `paused_executions`, and would silently move live runs between the
9494
* `pending` and `paused` buckets of a shipped field that internal log consumers read
9595
* from the same query — a breaking change, not a correction. Callers that need the
96-
* pause distinction read the run resources, which also carry the `paused` object that
97-
* separates "waiting on a human" from "a resume attempt failed".
96+
* pause distinction read the run resources, which also carry the `paused` object with the
97+
* pause kind, resume time, and any automatic-resume waiting reason.
9898
*/
9999
export const v2LogStatusSchema = z
100100
.enum(PERSISTED_WORKFLOW_EXECUTION_STATUSES)

‎apps/sim/lib/api/contracts/v2/workflows.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,11 +1988,12 @@ const RUN_STATUS_DESCRIPTION =
19881988
/**
19891989
* The list projection passes `workflow_execution_logs.status` through except where it
19901990
* overlays `paused` for a run holding a `paused` or `partially_resumed` row in
1991-
* `paused_executions` — so a reported `paused` is either that overlay or the persisted
1992-
* value a failed resume attempt left behind. Both branches land in the persisted set, so the reported enum is
1993-
* derived from it — a value missing here fails the response parse, and because list
1994-
* validation is whole-page one such row turns an entire page into a 500. `queued` is not
1995-
* reportable: a run still only in the job queue has no log row to list.
1991+
* `paused_executions` that still has a point to resume (a finished run whose every point
1992+
* resumed or failed reads its log status). A reported `paused` is either that overlay or the
1993+
* persisted value a failed resume attempt left behind. Both branches land in the persisted
1994+
* set, so the reported enum is derived from it — a value missing here fails the response
1995+
* parse, and because list validation is whole-page one such row turns an entire page into a
1996+
* 500. `queued` is not reportable: a run still only in the job queue has no log row to list.
19961997
*/
19971998
export const v2WorkflowRunListStatusValueSchema = z
19981999
.enum(PERSISTED_WORKFLOW_EXECUTION_STATUSES)

0 commit comments

Comments
 (0)