Repository navigation
fix(tui): report a removed checkout after a clean archive - #716
Merged
Merged
Conversation
A successful archive and cleanup still reported "worktree kept — it has uncommitted work". The retirement follow-up looked for a `removed` row in the roster, but `snapshots` drops a removed Session entirely, so the check was always false and the warning was always shown. A blocked cleanup keeps the row as `retained`, so the row's presence — not a lifecycle it never carries — is the signal that the checkout is still on disk. Cover both directions with tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Archiving a managed Session whose worktree is clean removed the checkout, but the TUI still reported:
Root cause
crates/forge-tui/src/app/input.rsdecided between the two messages by looking for aSessionLifecycle::Removedrow in the roster. A removed Session never appears there: the supervisor'ssnapshots()drops the row fromstate.actorsand it is not carried inunavailable_tasks. The lookup was therefore alwaysNone, soremovedwas always false and every successful archive + cleanup reported the blocked-cleanup warning.A blocked cleanup is the case that keeps the row — as
retained.Fix
The retirement follow-up now reads the row's presence, not a lifecycle it never carries: absent (or explicitly
Removed) means the checkout is gone; still listed means it is on disk. The blocked path still warns, which is the honest report for it.Tests
a_clean_archive_reports_the_checkout_removed_not_uncommitted_work— reproduced the report before the fix (left: "worktree kept — it has uncommitted work"), now asserts the success message andOkseverity.a_blocked_cleanup_reports_the_kept_checkout— the other direction: real uncommitted work still leaves the rowretained, still listed, still warned.Verification
cargo test --package forge-tui --locked app::tests::multi_task→ 55 passed.cargo fmt --all -- --checkclean.cargo clippy --package forge-tui --all-targets --lockedclean.The
.forge/localruntime subtree is git-excluded, so the underlying cleanliness check is accurate — this was presentation only, no worktree is removed that was not removed before.