fix(cmux-next): a refused new tab, split, column or row carries the real failure (FC-1)

Merged
LA
5d ago
+73-38

Summary

A refused New Terminal Tab, split, New Column or New Row now reports the real failure (the daemon's answer, a lost connection, a terminal start time-out) instead of a fixed text.

FC-1 (fuzz catalog): about 6 s after launch, the first New Terminal Tab from Home's dock failed in 4 of 5 bench launches with "new-tab: the daemon refused the new tab". NewTerminalTabCommand threw a fixed NewTerminalTabFailure for every failure of its new-tab, so the cause was only in the unified log. PaneSplitCommand, NewColumnCommand and NewRowCommand did the same with "the daemon refused the split" (PaneSplitFailure).

  • Each optimistic create now rethrows its request's own failure (try await send().get()). PaneNotReady and PendingPaneNotCreated keep their typed handling in ActionWorkFailure.create.
  • New Column and New Row now also keep PendingPaneNotCreated. Before, they turned it into the fixed split text.
  • A typed time-out now reaches ActionWorkFailure again, so mayHaveApplied and terminalMayAppear are correct for these creates.
  • NewTerminalTabFailure and PaneSplitFailure are removed. Nothing else used them.

This PR does not fix why the first tab after launch is refused (Home's pinned dock before its allow_tabs). That fix comes in a separate PR. This PR makes the refusal name its cause.

Changelog

  • Fixed: A refused new terminal tab, split or column now says why it failed instead of "the daemon refused the new tab".

Testing

Regression test: RefusedCreateKeepsDaemonReasonTests (CmuxNextAppTests, same-tree cmux-tui). It creates in a pane id that the daemon does not have, and expects the daemon's own answer (DaemonError.command).

Observed / Not run

  • Observed: the red and green fleet steps above, the compile-check, and prepush-gate.py with no new violations.
  • Observed on a display worker (gui-session-v1, cmuxs-Mac-mini-3, "gui-session-v1 step in cmux's console session"), at head 77810a0400bb, CMUX_TEST_REQUIRE_GUI=1: step 1711045834f5bd48760b0a88 passed RefusedCreateKeepsDaemonReasonTests (2 of 2) and the existing CmdNThenNewTerminalTabTests (3 of 3).
  • Not run: the full CmuxNext suite, and a dogfood build. I read, but did not run, the call sites of these creates (PaneController.newTerminalTabNow, PaneHandlers.split, WorkspaceContentController.newColumn/newRow); they all go through ActionWorkFailure.create.

No capture: no UI layout change; only the text of a refusal changes.

perf claim: none