Problem
bounded-cleanup-eligible-apply can fail safe removals with a fixed 5 second timeout:
reason_code: remove_failed
reason: remove failed: Process command timed out after 5 second(s).
Observed examples during a large cleanup:
wpcom-codebox@fix-issue-117-editor-auth-redirect-loop
wpcom-codebox@fix-issue-118-local-runtime-fixtures
wpcom-codebox@fix-issue-120-editor-proof-workflow
wpcom-codebox@fix-selected-page-seed-boot-timeout
wpcom-codebox@issue-116-local-auth-preflight
studio@fix-auto-mount-wp-config-paths
woocommerce@fix-layered-nav-count-cache-bound
These rows had already passed cleanup eligibility checks, but removal could not complete within the fixed command timeout. Re-running sometimes helped, sometimes did not.
Desired behavior
Cleanup removal should be robust for large/slow worktrees:
- Make the remove timeout configurable for cleanup operations, or use a larger default for bulk cleanup.
- Preserve per-row revalidation before removal.
- Emit a continuation command for timeout rows.
- Distinguish timeout from unsafe state changes.
Safety expectation
A longer timeout must not weaken dirty/unpushed/primary protections. It should only give git worktree remove enough time to complete once the row has passed safety checks.
Problem
bounded-cleanup-eligible-applycan fail safe removals with a fixed 5 second timeout:Observed examples during a large cleanup:
wpcom-codebox@fix-issue-117-editor-auth-redirect-loopwpcom-codebox@fix-issue-118-local-runtime-fixtureswpcom-codebox@fix-issue-120-editor-proof-workflowwpcom-codebox@fix-selected-page-seed-boot-timeoutwpcom-codebox@issue-116-local-auth-preflightstudio@fix-auto-mount-wp-config-pathswoocommerce@fix-layered-nav-count-cache-boundThese rows had already passed cleanup eligibility checks, but removal could not complete within the fixed command timeout. Re-running sometimes helped, sometimes did not.
Desired behavior
Cleanup removal should be robust for large/slow worktrees:
Safety expectation
A longer timeout must not weaken dirty/unpushed/primary protections. It should only give
git worktree removeenough time to complete once the row has passed safety checks.