Chief: release Home and stop Chief when chief.enabled is off

Closed
AU
2d ago
+475-26

Summary

Fixes #26003.

With chief.enabled: false, the Home workspace and its pinned Home group stayed in the sidebar, and nothing could remove them. Every pin, close and ungroup guard protected Home whatever the setting said. The running Chief service also survived the change, so a message typed into Home still started a harness and Chief still replied. cmux workspace-group unpin printed OK even though the guard ignored the request.

After this change:

  • Home is protected only while chief.enabled is on. Workspace.isChiefHome, TabManager.isChiefHomeGroup and the Home pane's split-tree close guards (ChiefPanel.isProtectedHome) check the setting. Workspace.holdsChiefHomePane keeps the setting-independent identity.
  • ChiefHomeNavigation.removeHome runs when the setting turns off, when a window appears, and after a session snapshot is applied. It unpins the Home group and removes Home:
    • A Home workspace that holds only Chief panes is closed. If Home is the window's only workspace, a fresh workspace is created first.
    • If the user added other panes or Dock panels to Home, only the Home pane is removed and the rest stay.
    • Automatic removal leaves the hidden-conversation list unchanged. The group is unpinned only alongside a removal, so a later pin by the user stays.
  • When the setting turns off, ChiefService stops: it ends turns and harness processes, drops the store and removes its observers. start() does nothing while the setting is off. An owner load that finishes after a stop shuts itself down.
  • workspace-group unpin on the protected Home group (Chief enabled) now returns a protected error instead of OK. TabManager.setWorkspaceGroupPinned returns whether it applied, and the control seam (ControlWorkspaceGroupPinResolution) and the mobile action both report a refusal.

Testing

Regression test: cmuxTests/ChiefDisabledHomeTests, run with ./scripts/run-e2e.sh cmuxTests/ChiefDisabledHomeTests --ref <sha>.

Observed / Not run

  • Observed: the focused runs above, plus local swift-syntax parsing of the changed files and scripts/localization_catalog.py check (0 parity errors).
  • Tagged build 26003-fix at 5acc33f: fleet job c48edf3f57a101724a52a337, published to the HQ cache. Not launched or driven by the agent.
  • Not run: a live relaunch with Chief off and a saved Home snapshot. That path is covered by code reading and by the removeHome unit tests, not by an app relaunch.

Localization: one new key, workspaceGroup.error.chiefHomeCannotUnpin, translated for all 9 macOS locales through scripts/localize-changes.

Changelog

Fixed: Turning Chief off now removes the Home workspace, stops Chief, and no longer leaves a pinned Home group that can't be unpinned or closed

Proof

The change is in sidebar state and the service lifecycle; the unit tests above cover it. No visual change beyond Home being removed.

🤖 Generated with Claude Code