Repository navigation
fix: orphan restart release must not delete clean worktrees - #839
Conversation
Daemon restart reconcile was routing through item_release cleanup (#335), which wiped live mid-work checkouts before rediscovery. Add preserve_worktree for that path so abandon releases still clean and reclaim can resume. Agentflare-Agent: cursor Agentflare-Branch: task/322-fix-orphan-restart-release-must-not-dele Agentflare-Item: 322
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: getappz/agentflare/.coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. 📝 WalkthroughWalkthroughRelease requests now support preserving an item worktree. The MCP release handler skips cleanup when the flag is true. Orphan-job reconciliation uses a CLI helper that enables the flag. Tests verify that committed files remain in the worktree. ChangesOrphan worktree preservation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The change keeps clean item worktrees in place during daemon-restart orphan recovery, and normal abandon releases still clean them up. No actionable merge-blocking risk was identified in the supplied context. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
Claiming self-repair for |
supervisor — CI self-repair dispatchedFailing checks: fmt. Please investigate and push a fix. job: DZNQSc9xu_k1TDTgX1fB- |
Co-authored-by: Cursor <cursoragent@cursor.com> Agentflare-Agent: cursor Agentflare-Branch: task/322-fix-orphan-restart-release-must-not-dele Agentflare-Item: 322
supervisor — CI greenChecks are passing again. |
Using systematic-debugging and lean-ctx to fix orphan-restart deleting clean worktrees. Checking skills and locating the release/cleanup path.lean-ctx unavailable (readonly DB) — falling back to native Grep/Read.Bypassing lean-ctx shell hook (
LEAN_CTX_DISABLED) so verification can run.Checking whether reclaim resumes the item branch or recreates from default — that determines what orphan cleanup actually loses.Shadow mode is blocking native Grep/Read — using shell redirects for code access.Writing the failing test first (TDD), then the minimal preserve_worktree fix.Edit tools are seeing compressed lean-ctx views — patching via shell instead.Preserve test passed. Running the remaining cleanup/orphan regression tests.Orphan test looks stuck mid-cargo — killing it and rerunning alone with a timeout.All targeted tests passed. Cleaning probe files and committing.LOC gate blocked the commit — moving the new unit test out of the oversizedaction_tests.rs.Status: done —8ad435contask/322-fix-orphan-restart-release-must-not-deleChange: Orphan-restart now uses
release_and_comment_preserving_worktree→item_releasewithpreserve_worktree: true, so #335 cleanup still runs on normal abandon but not on daemon-restart reconcile.Tests (all pass):
item_release_preserve_worktree_leaves_a_clean_worktreereconcile_orphaned_jobs_preserves_a_clean_item_worktreeitem_release_removes_its_own_clean_worktree(abandon still cleans)item_release_leaves_a_dirty_worktree_in_placeitem_done_removes_its_own_clean_worktreeConcerns: Branch is ahead 1 / behind 1 vs
origin/master. No dedicatedcheck_mergeworktree test re-run (that path untouched). Otherrelease_and_commentfailure paths still clean clean trees before rediscovery — only orphan-restart preserves.Done. Fix is committed as8ad435contask/322-fix-orphan-restart-release-must-not-dele.Orphan-restart release now preserves clean worktrees; normal abandon still cleans them. Targeted unit tests passed before the commit.
Opened by
cursoron flared:51bb8de6c33b for item #322 via agentflare.Summary by CodeRabbit