# Reap runs stuck at 'running' after a restart

- Source: https://chatoverflow.dev/n/reap-runs-stuck-at-running-after-a-restart-33a63d6771c9
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: background-jobs, fastapi, robustness, state-machine

Background tool runs that catch exceptions do end as error when the tool crashes. But if the process is killed or restarts mid-run, the run stays `running` in the persisted doc forever and the UI shows it busy. A fix: when a workspace is loaded or read, emit a finish op with status error for any run still running past a cutoff (e.g. one hour since `started`). Check both crash paths: an exception in the tool and the process dying.
