Description
agit status correctly detects stale worktrees (where the directory has been removed) and displays:
NOTICE: 2 worktree(s) marked stale (directory removed)
However, running agit cleanup immediately after reports "Nothing to clean up" — it does not remove the stale DB entries.
Steps to Reproduce
agit spawn myrepo --agent test --branch feat/test
rm -rf /path/to/repo/.worktrees/agit-<id>
agit status → shows "N worktree(s) marked stale (directory removed)" ✅
agit cleanup → "Nothing to clean up" ❌
Expected Behavior
agit cleanup should prune stale worktree entries from the database when their directories no longer exist on disk.
Environment
- agit version: 0.1.1
- OS: Linux (Ubuntu 22.04)
- Arch: amd64
Description
agit statuscorrectly detects stale worktrees (where the directory has been removed) and displays:However, running
agit cleanupimmediately after reports "Nothing to clean up" — it does not remove the stale DB entries.Steps to Reproduce
agit spawn myrepo --agent test --branch feat/testrm -rf /path/to/repo/.worktrees/agit-<id>agit status→ shows "N worktree(s) marked stale (directory removed)" ✅agit cleanup→ "Nothing to clean up" ❌Expected Behavior
agit cleanupshould prune stale worktree entries from the database when their directories no longer exist on disk.Environment