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
Use linked PR state for settling and worktree cleanup, once Settled and forge support exist.
Spec
Settle on merge / close (setting auto_settle_on_merge, default on): a thread whose latest-terminal linked PR was closed, or merged with the setting on, is auto-settled — only when the close/merge happened at or after the last user activity (so reopened work is not re-settled). Any visible linked PR that is open or not yet synced blocks auto-settle entirely, inactivity included. A merely open branch PR does not block inactivity settling. Before settling on a terminal PR, re-check the branch for a newly opened PR.
Worktree cleanup on merge (opt-in): remove a Tcode-managed worktree only when both the host reports the PR merged and git merge-base --is-ancestor HEAD origin/<default> succeeds after a fetch; refuse if the worktree is dirty, shared, has a live terminal, or is not Tcode-managed. Squash merges fail the ancestry check by design; the snapshot/keep-count lifecycle from Worktrees: host-owned ownership and an archive lifecycle (snapshot, transfer, keep-count) #530 still applies.
The settlement sweep reacts immediately to PR merge/close events.
Summary
Use linked PR state for settling and worktree cleanup, once Settled and forge support exist.
Spec
auto_settle_on_merge, default on): a thread whose latest-terminal linked PR was closed, or merged with the setting on, is auto-settled — only when the close/merge happened at or after the last user activity (so reopened work is not re-settled). Any visible linked PR that is open or not yet synced blocks auto-settle entirely, inactivity included. A merely open branch PR does not block inactivity settling. Before settling on a terminal PR, re-check the branch for a newly opened PR.git merge-base --is-ancestor HEAD origin/<default>succeeds after a fetch; refuse if the worktree is dirty, shared, has a live terminal, or is not Tcode-managed. Squash merges fail the ancestry check by design; the snapshot/keep-count lifecycle from Worktrees: host-owned ownership and an archive lifecycle (snapshot, transfer, keep-count) #530 still applies.Dependencies
#526, #532, #530.
Reference
T3 Code
ThreadSettlementPolicy.ts(PR rules), #9528, #12161;apps/server/src/storageCleanup.ts(#11598).