Skip to content

Auto-clean and auto-restore worktrees#535

Merged
bborn merged 1 commit intomainfrom
task/2455-taskyou-worktrees-dont-auto-clean-filled
Apr 28, 2026
Merged

Auto-clean and auto-restore worktrees#535
bborn merged 1 commit intomainfrom
task/2455-taskyou-worktrees-dont-auto-clean-filled

Conversation

@bborn
Copy link
Copy Markdown
Owner

@bborn bborn commented Apr 20, 2026

Closed-task worktrees were sitting on disk for 7 days before cleanup. This shortens the grace period and makes cleanup transparent to the user.

  • Default grace 7d → 24h.
  • Cleanup pass 1h → 10 min.
  • setupWorktree auto-unarchives saved state when needed. Queue or retry a closed task → worktree restores → existing --resume path brings the executor session back. No new commands.

Test plan

  • go build ./... && go vet ./... && go test ./... clean
  • Regression test pins DefaultWorktreeCleanupMaxAge ≤ 48h
  • Manual smoke: close a task, queue it again, confirm worktree restores and executor resumes with conversation history (needs a real git project)

@bborn bborn force-pushed the task/2455-taskyou-worktrees-dont-auto-clean-filled branch from e0d9c27 to 32748ac Compare April 28, 2026 11:40
@bborn bborn changed the title Auto-clean task worktrees and monitor disk pressure Auto-clean worktrees with artifact preservation + ty reopen Apr 28, 2026
@bborn bborn force-pushed the task/2455-taskyou-worktrees-dont-auto-clean-filled branch from 32748ac to 02ed834 Compare April 28, 2026 12:04
@bborn bborn changed the title Auto-clean worktrees with artifact preservation + ty reopen Auto-clean and auto-restore worktrees, preserve gitignored outputs Apr 28, 2026
- DefaultWorktreeCleanupMaxAge 7d → 24h
- Stale-cleanup pass 1h → 10min
- setupWorktree auto-unarchives saved state when no live worktree
  exists, so closed tasks transparently come back when retried/queued

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bborn bborn force-pushed the task/2455-taskyou-worktrees-dont-auto-clean-filled branch from 02ed834 to 3a775cf Compare April 28, 2026 12:12
@bborn bborn changed the title Auto-clean and auto-restore worktrees, preserve gitignored outputs Auto-clean and auto-restore worktrees Apr 28, 2026
@bborn bborn merged commit 69dda25 into main Apr 28, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant