You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PID-based file semaphores in ~/.claude/nf-sem/ leave stale locks on crash #176
bin/provider-concurrency.cjs implements per-provider concurrency limits via PID-files in ~/.claude/nf-sem/. The cleanup is best-effort:
If a dispatched process exits cleanly, it releases its slot file
If the process crashes, gets killed (SIGKILL), or the parent shell terminates abruptly, the lock file persists with a stale PID
Subsequent slot acquisitions can be incorrectly blocked until a manual cleanup or until the file's stale-PID check fires
Surfaces as "all slots UNAVAIL with no clear reason" during stress / interrupted runs.
Flagged in .planning/quorum/debates/2026-05-13-is-the-quorum-robust.md by opencode-1 as bounded weakness #4.
Proposed solution
Switch to fs.flock-style advisory locking (POSIX/Windows-bridged via proper-lockfile or similar). OS-level locks release automatically on process exit regardless of how the process dies.
If POSIX-only is acceptable: use fcntl.flock via the @petamoriken/float16-style native binding, or flock(1) as a subprocess wrapper.
Fallback: extend the existing stale-PID check to run on every acquisition attempt, not just on file creation. A PID that doesn't exist in process.kill(pid, 0) → release the lock and continue.
Acceptance criteria
Killed processes (SIGKILL, parent shell exit) don't leave stale locks
No manual rm -rf ~/.claude/nf-sem/ needed for recovery
Concurrency limits still enforced under heavy load
Activity
fix(quorum): self-heal stale provider-concurrency semaphore locks (#176)
fix(quorum): self-heal stale provider-concurrency semaphore locks (#176)
fix(quorum): self-heal stale provider-concurrency semaphore locks (#176…