Whether this pass's writes to the submitting run will mean anything yet.
The Running case is the whole point. A graph can settle before the run that submitted it has
parked at all: finalizeAgentRun sets Pausedafter the graph is durable and dispatchable, so
a fast graph finishes first. Both of the settled branch's writes then land wrong — the lifecycle
write silently returns (its guard is Status === 'Paused'), and the cost write is overwritten
moments later by finalize's own full-row save carrying the nulls it held before the dispatcher
wrote anything. Neither failure is visible, and the pass then claims the delivery marker, making
itself the last pass ever to look at the graph. The run stays Paused forever.
Every other status proceeds: Paused is the case settlement exists for, and a run already
Completed/Failed/Cancelled reached that for its own reasons — the lifecycle write's own
guard declines it, which is correct, and delivery should not be held up by it.
Bounded, because "not parked yet" and "the submitter died before parking" look identical from
here. Waiting forever on the second loses the outcome of work that actually completed, which is
strictly worse than announcing it late — so past the grace period the caller proceeds and says
why. The run stays Running, which is visibly wrong and belongs to whatever reconciles abandoned
runs, not to the graph that finished correctly.
Parameters
runStatus: string
settledForMs: number
how long ago the graph reached its terminal status
Whether this pass's writes to the submitting run will mean anything yet.
The
Runningcase is the whole point. A graph can settle before the run that submitted it has parked at all:finalizeAgentRunsetsPausedafter the graph is durable and dispatchable, so a fast graph finishes first. Both of the settled branch's writes then land wrong — the lifecycle write silently returns (its guard isStatus === 'Paused'), and the cost write is overwritten moments later by finalize's own full-row save carrying the nulls it held before the dispatcher wrote anything. Neither failure is visible, and the pass then claims the delivery marker, making itself the last pass ever to look at the graph. The run staysPausedforever.Every other status proceeds:
Pausedis the case settlement exists for, and a run alreadyCompleted/Failed/Cancelledreached that for its own reasons — the lifecycle write's own guard declines it, which is correct, and delivery should not be held up by it.Bounded, because "not parked yet" and "the submitter died before parking" look identical from here. Waiting forever on the second loses the outcome of work that actually completed, which is strictly worse than announcing it late — so past the grace period the caller proceeds and says why. The run stays
Running, which is visibly wrong and belongs to whatever reconciles abandoned runs, not to the graph that finished correctly.