Repository navigation
feat(app): stopping several agents can archive their worktrees too - #179
Merged
Merged
Conversation
Archiving or removing a worktree without force used to stop its services and run the archive script first, and only then let git refuse a worktree with uncommitted or untracked files: the teardown ran on work that was then kept, and the box had already answered "archiving". Now it checks git status up front and refuses in git's own words, so every Archive path keeps dirty work before anything is torn down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Agent Dashboard's Stop and Clean up dialogs get "Archive their worktrees where it's safe" (remembered, off at first). Ticked, the agents stop, then each of their worktrees is archived once, through the same path as the sidebar's Archive…: the archive script runs and the branch is kept. One with uncommitted changes, with another agent still running in it or a folder under it, where an agent didn't stop, or on a box that didn't list its sessions is kept as it is, and its row says why. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stener1
force-pushed
the
bulk-stop-archive
branch
from
October 21, 2026 14:39
a60df6e to
64bc8b4
Compare
|
@Stener1 is attempting to deploy a commit to the seanbrydonio's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
On the Agent Dashboard you pick several finished agents and Stop them, but their worktrees stay. To finish the work you then open each worktree and archive it, one at a time. The Stop and Clean up dialogs now have Archive their worktrees where it's safe.
berth.dashboard.stopArchives). It shows only when a picked agent works in a worktree that isn't the main checkout. Unticked, the dialog is as before.dropWorktreestopped services and ran the archive script before git refused a dirty worktree. The teardown ran on work that was then kept, and the box had already answered 202 "archiving". It now checksgit statusfirst and refuses in git's own words. This applies to every Archive and Remove path (sidebar, Worktrees table, this dialog);forcestill skips it.keepsWork) and the archive wording local, matching the Worktrees table. It doesn't touchremove-worktree.ts,use-bulk.tsor the sidebar, so it merges cleanly beside other work on archiving there. MovingkeepsWorkto one shared place is a small follow-up.Evidence
Driven with the verify skill's new
dashboard-stop-archivescenario (production build, mock fixtures, Chromium, no console errors). Four agents are picked so that every outcome shows.On a real box (
dev-box.sh up, then the newscripts/archive-dirty-live.sh, which goes through the laptop agent's API):Before the fix the box took that request asynchronously (202) and ran the script first. The Go test below shows this, failing on the unfixed code; I didn't drive a box built from main.
Tests:
TestADirtyWorktreeIsRefusedBeforeItsArchiveScriptRunsfailed before the fix (async=true err=<nil>) and passes after.archive-after-stop.test.ts(5) covers: archived once per worktree; main checkout and loose agents are never candidates; another live agent (root or subfolder, not a sibling path) keeps it; partial or total stop failure; a box that didn't list keeps its worktrees.e2e/dashboard-stop-archive.spec.ts(4) covers: ticked → clean archived and dirty kept, dialog open; another agent → kept; unticked → nothing archived; choice remembered, and no box for a main checkout alone. 20/20 with--repeat-each=5.go vet,go test -race ./..., the app checks,pnpm test577, build,tsc -p e2e, docs build) all pass.internal/agentandleadline/apifailed once under the full-racerun and passed on rerun.keyboard.spec.ts"⌘⇧E … Files panel" fails on main too.Not shown here: the app driving a real box's agents through this dialog. The mock runs the same request path, and the box side is shown above.
Accessibility: axe over the open dialog flags only the board's cards behind it (
.opacity-70meta text), which predates this change.Merge Danger
Door: two-way
The dialog's box is off until ticked. Archiving keeps branches. The box change only refuses earlier what git refused anyway, so a dirty worktree is kept as before, minus its teardown. No migrations.
Blast Radius: worktree-removal
Every non-forced Archive or Remove of a worktree with untracked, non-ignored files now fails at once with git's message, where before it stopped services (and ran the archive script) first. Review worktrees removed by
dropWorktreewithout force get the same check.🤖 Generated with Claude Code