cmux NEXT: a link from another app never reshapes Chief's Home

AU
6d ago
+189-3

Fixes https://github.com/manaflow-ai/cmux/issues/27897

What

With cmux NEXT as the default browser and Chief's Home shown, a link clicked in another app opened as a new pane column inside Home, which changed Chief's layout.

Root cause: ExternalOpenController.perform delivered the URL to the window's focused pane. On Home, that pane is the chat's pinned dock, and PaneBrowserTabOpener / HomeDockOpens move any tab made in the dock into a new column beside it.

Fix: ExternalOpenController now treats the Home workspace (kind == "home") the way it already treated the Home top page. A tab, terminal, ssh: link or file from another app opens in the window's most recent other workspace, or in a new workspace when the window has none. Links in this build's own scheme (cmux://…) still run link.open where they are. That path only navigates, so Chief deep links keep working on Home.

Sidebar-card links and terminal links with no source pane use the same perform path, so they also open outside Home now instead of adding a column there.

Regression check

scripts/cmux-next/home-external-open.py is a tagged-app live check that uses only the control socket. It shows Home, focuses the dock, sends https://example.com/?cmux-27897 through debug.external_open (the same path as application(_:open:)), and checks that:

  • the window now shows a workspace other than Home, with a browser tab;
  • after home.show, Home's panes and tabs are the same as before the open.

Command: python3 scripts/cmux-next/home-external-open.py --socket /tmp/cmux-debug-<tag>.sock against a fleet DEV build launched in the background with an isolated Chief home.

The second fix commit (b64d9125e113) handles a fresh profile. There, the workspace created to hold the link shows before its first pane mounts. The waiting link now opens when that pane mounts, not on the next content switch.

Changelog

  • Fixed: with cmux NEXT as the default browser, a link opened from another app while Chief's Home is shown opens in a normal workspace instead of splitting Home.

Observed / Not run

Observed:

  • scripts/cmux-next/prepush-gate.py passed with no new violations (app-size warnings only).
  • The live check was red on the base and green at the exact head, in two cases: a profile with only Home (a new workspace is created) and a profile that already has a workspace.
  • A subagent correctness review, plus a re-review of the first-pane flush, found nothing blocking. Details are in the PR comments.

Not run: Swift unit suites; there are no unit test changes. Also not tested: an actual click in another app with cmux set as the macOS default browser. The live check uses debug.external_open, which calls the same ExternalOpenController.open as application(_:open:).

No capture: the visible result is a tab opening in another workspace. The live check's screenshots go in the results comment.

🤖 Generated with Claude Code