Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLI
Assigneesstack72

Relationships

#808 Execution cancellation: abort stuck workflow runs and model method runs, bulk cleanup, and daemon-restart reaping

Opened by stack72 · 6/24/2026· Shipped 6/25/2026

Summary

Combines #714 and #800 into a single feature request covering all aspects of execution lifecycle management when runs get stuck, orphaned, or need manual intervention. Covers both workflow runs and model method runs.

Problem

  1. Stuck runs — A workflow run or model method run can hang indefinitely (e.g. a lock holder crashed, a subprocess is wedged). The run stays in running status forever and downstream consumers (factory drive loops, dependent dispatches) keep treating it as in-progress.
  2. Orphaned runs — When the swamp daemon is killed or crashes, in-flight runs are left in running state permanently with no cleanup path. These accumulate indefinitely (54 zombie runs reported over 5 days).
  3. No CLI escape hatch — The only workaround today is manual surgery: grep ps for the process, kill it, edit the run YAML's status field, and restart swamp serve.
  4. Multiple execution paths — Serve manages runs across three separate tracking mechanisms (scheduled, WebSocket ad-hoc, webhook) with no unified way to cancel any of them.

Proposed

Unified cancel registry

A central RunCancelRegistry that all serve execution paths (scheduled, WebSocket, webhook) register their AbortControllers into, keyed by execution type and ID. Wired into executeWorkflowWithLocks and model method execution so all paths are covered.

Single-run abort

  • swamp workflow cancel [--run ] — cancel a workflow run
  • swamp model cancel [--run ] — cancel a model method run
  • If serve is running, send cancel request to serve API (fires AbortController for live cancellation)
  • If serve is not running, fall back to offline YAML cancel

Bulk cleanup

  • swamp workflow cancel --all to cancel all currently running workflow runs
  • Equivalent bulk cancel for model method runs

Daemon-restart reaping

  • On swamp serve startup, automatically detect runs left in running state by the previous daemon process
  • Mark them failed with reason daemon restarted

Workaround

Manually grep ps for the process, kill it, edit .swamp/workflow-runs//workflow-run-.yaml status field, restart swamp serve.


Supersedes #714 and #800.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 7 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

6/25/2026, 11:27:39 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/24/2026, 10:56:57 PM

Sign in to post a ripple.