Skip to content

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

Merged
lawrencecchen merged 2 commits into
feat-cmux-nextfrom
fix/fc1-create-refusal-real-error
Nov 1, 2026
Merged

lawrencecchen merged 2 commits into
feat-cmux-nextfrom
fix/fc1-create-refusal-real-error

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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).

  • Red at 0f02f68 (test only): fleet step beb57b13ee632dd07a4b013d failed, 4 issues: "isDaemonAnswer(failure → the daemon refused the new tab)", and "… the daemon refused the split" for split, New Column and New Row.
  • Green at 77810a0: fleet step 525a42197a5b679287f85df3 passed, 2 of 2 tests.
  • Compile: cmux-ci compile-check --app --package CmuxNext --recipe-version 2 job 5ba7458832c2bd04d8789620 passed (CmuxNext, app, cmux-tui).

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 77810a0, 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

…answer, not a fixed text (FC-1)

Right after launch a New Terminal Tab from Home's dock failed as
"new-tab: the daemon refused the new tab" in 3 of 4 bench launches; the
optimistic create threw a fixed NewTerminalTabFailure for every failure,
so the cause was only in the unified log. Split, New Column and New Row
throw the same kind of fixed PaneSplitFailure. Red on the base.
…eal failure (FC-1)

The optimistic creates threw a fixed text for every failure of their
request: "the daemon refused the new tab" (NewTerminalTabFailure) and
"the daemon refused the split" (PaneSplitFailure, also for New Column and
New Row). A lost connection, the daemon's own answer and a terminal start
time-out all read the same, so FC-1 (the first new tab after launch failed
in 3 of 4 bench launches) had no cause outside the unified log, and a typed
time-out lost its 'the terminal may still appear' meaning. Each create now
rethrows its request's own failure; PaneNotReady and PendingPaneNotCreated
keep their typed handling (ActionWorkFailure.create). New Column and New
Row now also keep PendingPaneNotCreated, which they turned into the fixed
split text. Both fixed-text types are removed (no other user).

Regression test: RefusedCreateKeepsDaemonReasonTests (red at 0f02f68).
@lawrencecchen lawrencecchen added the risk:low Risk tier (docs/ci/risk-tiers.md) label Nov 1, 2026
@lawrencecchen lawrencecchen added risk:normal Risk tier (docs/ci/risk-tiers.md) and removed risk:low Risk tier (docs/ci/risk-tiers.md) labels Nov 1, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 1, 2026

Copy link
Copy Markdown

Found 4 test failures on Blacksmith runners:

Failures

Test View Logs
main.DeveloperIdAppTests.test_download_prints_the_active_profile_only/
test_download_prints_the_active_profile_only
View Logs
stubs: /System/Library/Frameworks/Security.framework/Versions/A/Security has no stub/
Security has no stub
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_CFRetain']/
CoreFoundation, missing 1: ['_CFRetain']
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_log2']/
CoreFoundation, missing 1: ['_log2']
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (subagent, correctness first): SHIP at 77810a0

I read the code at the head and did not take the PR text as true. I did not compile or run tests on this machine.

Findings:

  • Callers: there are 4 optimistic call sites: PaneController.newTerminalTabNow, PaneHandlers split, and WorkspaceContentController.createInKeysTurn for newRow and newColumn. All 4 still catch their *Cancelled first, and they send every other error through ActionWorkFailure.create. PaneSplitCommand.sendIntended has no caller.
  • PaneNotReady: the code rethrew it before this change and still does. ActionWorkFailure.init copies shown, and .create only replaces the message. trackRollingBack skips shown, so the HUD does not show it twice.
  • PendingPaneNotCreated: New Column and New Row now keep it, where before they changed it into PaneSplitFailure. It now gets the localized .create text. This is a small improvement.
  • Time-outs: DaemonError.timedOut and terminalStartTimedOut now reach ActionWorkFailure.init, so mayHaveApplied and terminalMayAppear are correct. These values agree with what closeTicket/scopeFailure already reported to the action scope. The rollback and the R3 checkStandInRollback assertion run in intendNowReporting before .get(), so this PR does not change them.
  • try await send().get(): send() does not throw and returns a Result. Only the error value changes. noteReply, wasCancelled, applied and ProvisionalTab.created run in the same order, and only on success.
  • Removed types: nothing in Sources, Tests, other packages or the app target uses NewTerminalTabFailure or PaneSplitFailure now (git grep of the whole repository at the head). Some test comments still contain the old text, and no assertion compares against it.
  • Test: PaneID(987_654) is below ProvisionalPane.firstHandle (1<<62), so daemonTarget returns it at once. The createTab and splitPane overlays return nil when the pane is unknown, so nothing shows and no undo is recorded. The DEBUG R3 assertion does not trigger, because .command is not a client deadline. cmux-tui answers "unknown pane" for that id, and LineTransport turns the ok:false reply into DaemonError.command. The test has no sleeps or clocks. Note (no action needed): the new-tab test's check that the stand-in is gone is always true, because the overlay never showed a stand-in for an unknown pane.
  • Strings: the HUD frame action.effect.failed is localized. The reason is now the daemon's English text, for example "new-tab: new-tab failed: unknown pane N". Before, it was a different English text that was also not localized, so localization is not worse. .create says that other errors keep the daemon's own text.

Evidence:

  • Red at 0f02f68 (test only): beb57b13ee632dd07a4b013d failed with 4 issues ("the daemon refused the new tab" once, and "the daemon refused the split" for split, New Column and New Row).
  • Green at 77810a0: 525a42197a5b679287f85df3 passed 2 of 2 tests.
  • Compile-check: 5ba7458832c2bd04d8789620 passed for CmuxNext, app and cmux-tui.

perf claim: none

@lawrencecchen lawrencecchen added the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Nov 1, 2026
@lawrencecchen
lawrencecchen merged commit 3bfed21 into feat-cmux-next Nov 1, 2026
260 of 299 checks passed
@lawrencecchen
lawrencecchen deleted the fix/fc1-create-refusal-real-error branch November 1, 2026 09:31
@cmux-bot

cmux-bot Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Not verified: macOS jobs did not run: compile and app tests were skipped on 77810a0400; ci-status is green without them.

CI passes on 77810a0400 (run 41287552921 attempt 1).
macOS jobs did not run: compile and app tests were skipped: changes skipped, Fast static checks skipped (the macos job needs both to succeed). Re-run CI once they pass, before merging.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

Shipped in:

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 77810a04 Deployed Nov 1, 2026 by lawrencecchen via namespace autofix #10987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant