CLEAR STUCK RUNS
This guide shows you how to find runs that are stuck or orphaned and clear them so new executions can proceed.
Prerequisites
- Swamp installed and on your
PATH - An initialised repo (
swamp repo init)
1. Check what is running
swamp run history --activeIf runs are in progress, you will see output like:
STATUS KIND NAME ID AGE PID HOST
running method command/shell/execute cc665a58 3s 18669 Mac.localdomainA stale run — one whose process has crashed — shows a [STALE] marker:
STATUS KIND NAME ID AGE PID HOST
running [STALE] method command/shell/execute 58bb2b7f 2m 31822 Mac.localdomainIf nothing is running, the output is No tracked runs.
2. Diagnose stale runs
swamp run doctorThe doctor identifies stale runs and reports them:
1 stale run(s) detected:
KIND NAME ID HEARTBEAT AGE PID HOST
method command/shell/execute 58bb2b7f 2m 31822 Mac.localdomain
Run with --fix to automatically reap stale runs.If there are no stale or active runs:
No active or stale runs.3. Clear stale runs
To reap the stale runs the doctor found:
swamp run doctor --fix1 stale run(s) detected:
KIND NAME ID HEARTBEAT AGE PID HOST
method command/shell/execute 58bb2b7f 2m 31822 Mac.localdomain
Reaped 1 stale run(s).4. Verify the fix
swamp run history --activeThe stale run no longer appears. It has been transitioned to failed in the run
history.
On a remote server
If the stuck run is executing on a swamp serve instance, pass the server URL:
swamp run doctor --server ws://host:9090 --token mytoken.secretThe doctor checks the server's local run tracker rather than the local one.
swamp run history --server works the same way.
Next steps
swamp runreference — full flag tables and JSON output shapes- Cancel a Stuck Run — stop a run that is still executing (not stale)
- How Swamp Works — why the run tracker uses SQLite and heartbeat-based detection