Repository navigation
Description
Summary
The Tower view renders in every window, including a builder-worktree window, and its per-row Deactivate action stops that workspace's whole fleet: Tower's stopInstance kills the workspace's architects, shells and builder terminals. Used on the parent row from a builder-worktree window, it stops the parent architect and every sibling builder session, including the one belonging to that worktree.
This is pre-existing and by design, not a regression. It is filed because #1809 made the hazard visible and the question it raises was deliberately kept out of that lane.
Detail
- View:
codev.tower, contributed withwhenunset, so it renders in every window (apps/vscode/package.json). - Action:
codev.tower.deactivateWorkspace(apps/vscode/src/commands/switch-workspace.ts:190). It shows a modal warning, then callsclient.deactivateWorkspace(target.path). - Server side:
stopInstance(packages/codev/src/agent-farm/servers/tower-instances.ts:860) collects the workspace's terminals and kills them, flagging the workspace as intentionally stopping so architect exit handlers keep their persisted rows. - Row click (
codev.tower.openWorkspace) opens an active workspace's folder, and activates a dormant one, which spawns its architect (with an adopt-confirm when the folder has nocodev/).
There is no approve or gate action in this view.
Why a worktree window makes it sharper
In a builder-worktree window the window's own context is a worktree, while the Tower view lists the parent and every other workspace. The parent row is the one that looks like "my" workspace from in there, and acting on it stops sibling lanes that have nothing to do with the work in that window. During #1809's dev-gate testing the equivalent confusion was demonstrated with gate toasts: a worktree window raised toasts for the parent's lanes, each carrying an Approve button that would have approved a sibling lane's gate. Those toasts, the status-bar counts and the activity badge were suppressed for worktree windows in #1809; the Tower view was deliberately left alone as out of scope.
The decision this issue is for
Should a builder-worktree window be fully non-participating in fleet surfaces?
- Gate
codev.toweron!codev.isBuilderWorktree. Consistent with the Agents view and the trimmed Workspace view in a worktree window. Costs the fleet overview in that window. - Keep the view, guard the action. Leave the overview visible but refuse (or further confirm) Deactivate on a workspace other than the window's own, in any window.
- Leave as is. The modal confirm names the workspace, and a fleet view that cannot act on the fleet is arguably less useful than one that can.
A related question, if the second option is chosen: whether openWorkspace activating a dormant workspace (spawning its architect) deserves the same treatment, since that is also a side effect on something outside the current window.
References
Traced during #1809's dev gate; see that lane's review for the full trace. The suppression precedent for worktree windows is #1809's gate-toast / counts / badge change.
Activity