Merged upstreamCorrectnessMerged Aug 2, 2026
Reclaim stale local feature locks
Fixed clawpatch review recovery so stale same-host feature locks from killed runs can be reclaimed safely instead of permanently blocking later reviews.
openclaw/clawpatch · #170
Problem
A killed clawpatch review run could leave a per-feature lock behind. Future runs that selected that feature failed with feature locked, even when the recorded local process was already gone, while the existing clean-locks command was too broad to run automatically during active work.
Approach
Added conservative stale-lock reclamation that clears only same-host dead-PID locks before claiming a feature, introduced clean-locks --stale-only, and preserved live local locks, remote-host locks, and the existing full cleanup behavior.
Impact and scope
- Restores self-healing recovery for interrupted review runs without requiring manual lock-file deletion.
- Protects active and remote review work from accidental cleanup while unblocking provably stale local state.
- Reduces wasted review cycles by preventing one abandoned feature lock from failing the next review run.
Validation
- Added workflow and package-smoke regression coverage for stale local locks, live local locks, and remote locks.
- Verified real CLI behavior on a disposable git-backed fixture with clean-locks --stale-only and status checks.
- Documented passing build, typecheck, lint, format, focused tests, and full pnpm test suite evidence in the PR.