Chief: release Home and stop Chief when chief.enabled is off
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.enabledis on.Workspace.isChiefHome,TabManager.isChiefHomeGroupand the Home pane's split-tree close guards (ChiefPanel.isProtectedHome) check the setting.Workspace.holdsChiefHomePanekeeps the setting-independent identity. ChiefHomeNavigation.removeHomeruns 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,
ChiefServicestops: 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 unpinon the protected Home group (Chief enabled) now returns aprotectederror instead ofOK.TabManager.setWorkspaceGroupPinnedreturns 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>.
- Red, on the test-only commit 619b4fd338a3aa0c47ae0105c477d381c56de5cc, https://github.com/manaflow-ai/cmux/actions/runs/40623813935: both tests fail. Unpinning Home with Chief off left
isPinned == true,canCloseWorkspace(home)was false, Home was still intabs, andclosePanel(home)returned false. - Green, on head 5acc33f6cbe1cea31f46795103122d632c9ccf3c, https://github.com/manaflow-ai/cmux/actions/runs/40642469989: all 9 tests in the suite pass. They cover the 2 regression tests plus
removeHomeand the service: keeping a Home workspace that holds Dock panels, keeping hidden conversations, and leaving a later user pin alone. - Package tests in
ControlCommandCoordinatorWorkspaceGroupSafetyTestscover the protected unpin response. They run in PR CI.
Observed / Not run
- Observed: the focused runs above, plus local
swift-syntaxparsing of the changed files andscripts/localization_catalog.py check(0 parity errors). - Tagged build
26003-fixat 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
removeHomeunit 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