Cloud: keep terminal creation targets and errors visible
Cloud terminal splits could lose their remote placement and leave a blank local pane. The snapshot comparison now ignores connection-only session fields, normalizes omitted lifecycle values, compares rows by identity, and keeps unknown fields strict. Explicit terminal targets resolve to their owning workspace across windows. A failed Cloud route stops before local terminal creation. Routing uses retained projection identity even while the provider resource graph is absent, including Cmd+D, Cmd+T, and split-button paths; an unseeded UI pane is closed on failure.
| Before (Cloud error card in a narrow pane) | After (Cloud error card in a narrow pane) |
|---|---|
Cloud errors use a native opaque card above the terminal portal. It belongs to the visible workspace, keeps dismissal and Retry actions, and does not take pointer input outside the card. Layout creation retains the request key across retries. During GUI verification, a 190-point pane exposed another defect: the reconnect card extended outside the pane and hid Close. Its width now follows the pane bounds, its title wraps, and both actions stay inside the pane.
Validation:
- Merged
mainthroughbe7d9fa701d. GUI verification source is3d2105937a14bc7b1d2d5efe203bf656e810193d. Current head is16f87d9e6177ea435d67989a710dde6557b27ecc. - Rebuilt and installed tag
blnk13in fleet runblnk13-f6135d7ab7ae. The bundle embedsCMUXCommit=3d2105937and passes strict code-sign verification. Open blnk13. - On the approved GUI build, visible split and Cmd+T opened Cloud prompts. Three repeated terminal opens reused the same local panel and remote tab. A drag in the left pane, with the right pane initially focused, selected only left text.
- On the approved GUI build, paused-machine Cmd+D showed the narrow failure card. After resume, Reconnect restored a Cloud prompt in the same pane.
- The workspace-level card was also visually checked above 35 rows of terminal text and disappeared on workspace change. That supplemental capture is from source
718b1ba74ae; the workspace-card implementation is unchanged in the approved GUI build. - Native layout checks compiled the real view and dependencies on a leased Mac. The old view had 10 containment failures; the fixed view had zero across 720, 190, 320, and 190-point widths. Reconnect still invoked its action. The regression test and fix are separate commits.
- Project wiring (954 tests), Swift parsing, localization parity (six catalogs, nine locales), and diff checks pass. All 64 focused tests passed in https://github.com/manaflow-ai/cmux/actions/runs/35188535724: pairing (18), snapshot comparison (9), pane creation/focus (14), manual mirror presentation (11), and surface socket commands (12). The semantic integration and required PR checks also passed. This is focused coverage, not a full application test run.
- Restored the missing provider key only in the development test stack. VM creation then succeeded. The disposable VM and verification workspaces were removed.
Complete local evidence is in artifacts/feat-cloud-terminal-blank-rootcause/before-after/index.html, including the supplied original recording, final screenshots, command receipts, cleanup receipt, and source manifest.
[!NOTE]
Medium Risk
Touches cloud terminal routing, revision comparison, and window-level overlay installation—areas where regressions could affect split behavior, sync conflicts, or input focus—but changes are guarded by substantial new tests.
Overview
Improves Cloud terminal splits/tabs so a remote placement failure no longer silently opens a blank local pane, and users get clearer, on-top error UI in narrow layouts.
Routing & state: Split/tab gestures only succeed as “routed to remote” when the cloud route actually works; otherwise the operation fails without creating a local terminal. Snapshot revision equality is relaxed for benign wire differences (resource row order, omitted lifecycle vs running, live terminal title/size) so legitimate retries don’t look like conflicts. Layout terminal creation keeps the caller’s idempotency/correlation keys and retries once on revision conflict.
Errors & diagnostics: Adds a dedicated placement failure type (localized) for missing workspace/placement on the machine. Socket/VM error paths preserve more actionable catalog/VMClientError text while redacting raw HTTP bodies in formatted messages.
UI: Replaces the SwiftUI cloud pane creation failure overlay with a native window-level card above AppKit terminal portals (workspace-scoped visibility, retry/dismiss, no click-through). The reconnect overlay sizes to the pane with wrapping title so controls stay inside very narrow splits.
Targeting: Strict socket workspace_id / pane_id / surface_id resolution validates owners across windows; sidebar focus clears main-panel keyboard intent before focusing an opened terminal. Cloud manual-mirror panels are treated as the focused input surface.
Reviewed by Cursor Bugbot for commit 03d86daf96e8222ac7a2340fd319d017bf2e9d22. Bugbot is set up for automated code reviews on this repo. Configure here.
Merge repairs: use a named main-actor function for escaping Cloud action closures; restore the exact pairing deadline implementation and translations from 4ec20ab387f that main merge c5a666ad409 dropped while retaining its tests; locate native error-card buttons by their accessibility identifiers. The previous semantic test job could not compile because of that dropped pairing constructor.
Final verification also covers retained Cloud identity without a provider graph for tab creation, programmatic splits, and the UI split button. Test fixtures enable Cloud explicitly and assert pane-owned failure/retry plus the current quiet-connection and sizing-release contracts. A fresh blnk13 reload for this head is tracked at https://github.com/manaflow-ai/cmux/actions/runs/35189245262.