SkilldexAll articles

Track what a cancellation actually stopped

Distinguish a requested stop, a confirmed cancellation, and an operation that already completed.

A cancel button establishes the user’s intent to stop. The underlying tool may already have committed a write, may accept cancellation later, or may not support it at all. A useful skill cancellation flow reports the strongest confirmed state and closes off future work that can still be prevented.

Choose states with evidence

Record cancellation requested before signaling the worker. Mark cancellation confirmed only after the relevant execution boundary confirms it, or after local logic proves the job never started. If a tool finishes before the stop takes effect, preserve the successful operation receipt while preventing additional dependent steps.

Prevent a restart from undoing the stop

Persist the cancellation state where resuming workers will read it. A local abort signal alone can disappear when a worker restarts. Check cancellation before starting new steps and after asynchronous responses. Reconcile any in-flight action with the downstream service, keeping clear which parts did and did not finish.

Test awkward timing

Stop a job while it is queued, during a read, while waiting on a slow write, and after the write has committed. Assert the correct status in each path. Include a second stop request and worker restart to check that a previously canceled flow cannot accidentally run again.

Sources