Build1 distinct publisher3 min readUpdated
A dev.to piece argues cancellation must be a recorded run state with a version, not a boolean inside a process. The consequence is duplicate side effects after a crash.
The Engineer · Build desk
Compiled by The EngineerSomething wrong?How this is made
A post on dev.to makes a narrow and useful argument: a stop button is not a cancellation protocol, because by the time an operator clicks it the work may already be queued, claimed by another worker, sitting inside a browser session, or waiting on an outbound side effect [s1c1]. The consequence is the part worth caring about: if cancellation is not represented as durable state, a restart can resurrect work the operator thought they stopped [s1c2]. The reframing is to stop asking whether the process received SIGTERM and instead ask whether every layer can prove three things: whether this run may still start work, whether in-flight work must finish, and what happened to side effects that were interrupted [s1c20]. That means cancellation has to be kept separate from process liveness. A worker can be alive while its run is cancelled, and a worker can die before it records the cancellation [s1c3]. The proposed minimum is five run states: ACTIVE, where new work may be admitted; CANCELLING, where no new work starts and in-flight work is observed or stopped; CANCELLED, where the run will not resume and no unclaimed step may dispatch; COMPLETED; and UNKNOWN, where the controller cannot prove whether an external effect happened [s1c4]. The row is stored durably with a monotonically increasing cancel_version, illustrated in the piece as run_42 / CANCELLING / 3 [s1c5]. Workers carry the version they observed, and a dispatch is only valid if the durable row still says ACTIVE at that same version, which closes the race where Stop is pressed after a worker checked the run but before it starts a tool call [s1c6]. This is why the article insists the critical operation is a compare-and-set rather than a read followed by a write: the transition to CANCELLING increments cancel_version and only applies where status is still ACTIVE [s1c15]. Worker dispatch is guarded the same way, with the step update conditioned on an existence check against the run row at the exact observed version [s1c16]. If that update affects zero rows, the worker must not call the tool; it releases the claim and records CANCELLED_BEFORE_DISPATCH [s1c17]. A check at the top of the agent loop is too weak. The contract has to be enforced at every boundary that can create work, and the piece names six: admission, queue claim, tool dispatch, retry scheduling, browser actions, and outbound delivery [s1c7][s1d1]. Two of those carry the most operational weight. Cancellation must revoke future retries, not just the current attempt [s1c8]. And delivery policy is independent of execution cancellation: cancelling a code-generation run does not prove that an already-created notification was unsent, so execution and delivery need separate records [s1c9]. The honest-failure discipline follows. Do not mark a run CANCELLED merely because the worker process exited, since a process can die after sending a request and before recording the response [s1c12]. For every external side effect, record an intent with a stable key before dispatch, then reconcile UNKNOWN with the provider's lookup API, a webhook, or an operator decision [s1c13]. A cancellation timeout should land in UNKNOWN or CANCELLING_TIMEOUT rather than silently in success or cancellation, so the ambiguity is visible instead of becoming duplicate work on restart [s1c14]. Cooperative cancellation, where the worker notices the state change at a safe checkpoint and exits, is the default; forced cancellation is the deadline for the worker that will not cooperate [s1c10]. The sequence runs ACTIVE to CANCELLING with admission and retries revoked, then a drain of safe checkpoints, then CANCELLED if nothing is in flight or UNKNOWN if an external effect cannot be reconciled [s1c11]. What to watch in your own implementation is the evidence requirement, not the state names: for each injected failure the article asks you to assert no unauthorized new effect, no lost cancellation intent, and a record an operator can explain later [s1c18].
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
A stop button is not a cancellation protocol; in a real agent, work may already be queued, claimed by another worker, inside a browser session, or waiting for an outbound side effect.
If cancellation is not represented as durable state, a restart can resurrect work the operator thought they stopped.
The useful question is not whether the process received SIGTERM, but whether every layer can prove whether the run may still start work, whether in-flight work must finish, and what happened to side effects that were interrupted.
Cancellation should be kept separate from process liveness: a worker can be alive while its run is cancelled, and a worker can die before it records the cancellation.
A minimal run state machine has ACTIVE (new work may be admitted), CANCELLING (no new work may start; in-flight work is being observed or stopped), CANCELLED (the run will not resume and no unclaimed step may dispatch), COMPLETED (the intended work finished), and UNKNOWN (the controller cannot prove whether an external effect happened).
The run state is stored durably with a monotonically increasing cancel_version, illustrated by a row of run_42, status CANCELLING, cancel_version 3, updated_at 2026-08-19T12:00:00Z.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Internally specific, externally unverified
The design is unusually concrete for an opinion post: a five-state machine, a versioned durable row, and two runnable SQL statements with defined zero-row behaviour, all reproducible by a reader. But the entire cluster is one self-published article with no code repository, no incident report, no test output, and no second publisher; the causal premise that restarts resurrect cancelled work is asserted rather than demonstrated, and the referenced injected-failure cases are never listed.
No adoption signal in cluster
The supplied source reports no release, deployment, benchmark, usage disclosure, or user of the described cancellation contract. The only product reference is a suggestion to evaluate managed OpenClaw hosting on Ampere, which carries no adoption, customer, or usage data. Nothing in the cluster supports an adoption measurement.
Mildly overstated certainty, no inflated capability claims
The article avoids capability hype: it explicitly disclaims instant termination as the goal and disclaims that managed hosting replaces durable run state. The modest gap comes from presenting universal prescriptions ('incomplete until it survives these injected failures', restarts resurrecting stopped work) as settled operational fact on the strength of one unverified essay, plus an in-line commercial suggestion whose relationship to the author is undisclosed.
Self-published post with an embedded product suggestion and follow CTA
The piece is author-controlled distribution on dev.to, ends with a call to follow for more control-plane content, and routes always-on agent operators toward a named commercial option, managed OpenClaw hosting on Ampere, with no disclosure of any relationship. That is a moderate promotional incentive, tempered by the fact that the technical body sells no product and the vendor mention is explicitly caveated as not substituting for the design work described.
Coherent single-author argument, no corroboration
Confidence is limited by structure more than by content: one publisher, one author, zero corroborating or contradicting sources, and no adoption dimension to triangulate against. What supports it is that the mechanics are specific enough to be falsified by any reader who implements them, and they align with well-established fencing and idempotency practice, so the assessment of what the cluster says is reliable even though the assessment of whether it works in production is not.
build
157 plans, one real model: the expensive agent failures land before the first tool call1 distinct publisher
build
Force the tool call, then hand Lightsail a long-lived key1 distinct publisher
build
AI-written code fails the same four ways, and every gate you own reports green1 distinct publisher
build
CSA's 2026 threat list is a flat line, so ask which threats a config snapshot can prove1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 19, 2026