Add opt-in Mac discovery with consistent workspace mirrors - #12105
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
My Devices adds opt-in discovery and terminal mirrors for other Macs on the same account. Outgoing discovery, incoming Mac access, and iPhone pairing remain independent choices. Opened Mac workspaces preserve their source splits, divider proportions, tab order, selection, terminal geometry, and scrollback; names reconcile across the device tree, workspace sidebar, and terminal tabs.
Mac layout synchronization uses authenticated, workspace-scoped revisions, stale-write rejection, idempotent request IDs, bounded validation, and rollback. Cmd-N in a device workspace creates on that same Mac. Disconnected mirrors retain their state and offer a pane-owned Retry/dismiss notice. Mac-only layout RPCs are not exposed through the SSH relay.
Updated from
origin/mainthroughc1fe9f87db(81cce8891b), with merge conflicts resolved while preserving the Devices integration: the Devices tree uses main's reference Cloud sidebar layout, and the "Run My Devices regressions" CI gate sits beside main's new "Run main window zoom placement regressions" gate on the same shard. Review fixes in1e93365cdd:The opt-in discovery default is intentional. The presence subscriber uses an injected clock for actual ping/pong protocol deadlines, with cancellation tied to its socket session; the corresponding review thread explains the existing architecture carve-out.
App-host CI stabilization
Every app-host unit test shard failed on this branch after main merged #13178, which fails a shard on any test-host restart or Swift Testing time limit. The crashes behind those restarts predate that change: this branch's last green run (
892c765503) had 17 host crashes across its six shards and passed only because the old classifier tolerated a restarted host. Each crash was symbolicated against the run's own build products and fixed at its source:AgentChatTranscriptService.deinitasserting the main actor whileAppDelegatewas freed on the session-persistence queue (7 of 17)AppDelegate.persistSessionSnapshotcapturedselfin the write block1a34b07fc6: the block retains only the snapshot storeretireRecoverableMainWindowRouteIfCurrentresolved owners before dropping the route4d92128a2b(failing test) then1b8551f38cKeyboardLayouton a Swift Testing worker threadKeyboardShortcutSpaceKeyTests16f2efb0ed: suite runs on the main actorNewCloudWorkspaceShortcutTests,VMSSHCommandTests,ViewerNavigationTests16f2efb0ed,2371a90055,fa25d4d6c0: require the element firstTabManager.initprecondition from a test subclass that rejected every creationWorkspaceCreateReviewRegressionTests1c6f8da198: rejection is armed after initresponds(to:)forwarding to itself inSidebarWorkspaceDragPasteboardWritera033d766d7: bounded forwarding chainUInt(windowNumber)trap for a window without a window-server numberCompositorBlurController.resetBackgroundBlura033d766d7: non-positive numbers ignoredNot fixed here: a
ghostty_surface_newnull dereference seen twice in the892c765503run and not since (GhosttyKit internals, no symbols), and the CLI integration assertion failures invm dev --dry-runand thevm sshalias, which the classifier tolerates and which come from main's Cloud CLI alias unification and #13193, not from this branch.On head
6f0d450afd(run 35555487415) shards 2 and 6 had zero host crashes; both failed on Swift Testing one-minute limits (CloudTerminalLayoutCreationTests,CloudDesktopWebSocketTests,CloudTerminalMutationRetirementTests,DeferredActionReplacementStackTests, all unchanged by this branch) while a WebKit content process took 49 to 51 seconds to launch (Could not signal service com.apple.WebKit.WebContent: 113, thenWebContent process took 50.92 seconds to launch), which blocks the main actor for every test in flight. Those launch stalls are chronic on the runners: the last green run had a 50.6 s launch in shard 1 and a 41 s launch in shard 3 that tripped four limits, tolerated before #13178. That interaction is a main/CI-side reliability problem (64 tests carry.timeLimit(.minutes(1))); shards that fail only on a stall are re-run rather than patched here.Two of the limit trips were deterministic on the runners rather than stall-starved:
smoothScrollingPageCapturesRequestedRegionAndRestoresOffset(shard 5, and shard 1 of the last green run) hung until the 300 s allowance:BrowserScreenshotSnapshotter.scroll(_:to:)and the DOM probe collector waited on tworequestAnimationFramecallbacks, which aWKWebViewoutside a visible window never delivers. That is also a real hang for a capture from a hidden web view.4c4b22daf6bounds the wait with a 250 ms timer; visible pages still settle on the frames first.computerUseFilesystemCallbacksHopSafelyToMainActor(shard 3, and shard 3 of the last green run) hung because its target was the test host itself, which the watcher ignores. Main rewrote that test around focus events (taken in the merge); this branch's interim fix was dropped in favor of main's.Main also fixed, in its own way, the
VMSSHCommandTestsbind indexing and the rejectingTabManagerfixture inWorkspaceCreateReviewRegressionTests; the merge takes main's versions. The fourRemoteTmuxMirrorPaneInputMappingTests300 s hangs seen in shard 1 (and in the last green run) are bounded by main's #13173, which arrives with this merge.Testing
DeviceWorkspaceLayoutTests, including malformed and excessive-depth/count snapshots.IrxBrokerArmingTests, including cancellation of an active registration behind a queued tail.6f0d450afd(run 35555487415): Fast static checks, linux preflight, macOS compile admission, swift-package-tests, tests-build-and-lag, release-build, and app-host shard 4 passed. Shards 1, 2, 3, 5, and 6 each ran with zero host crashes; every one failed only on a Swift Testing time limit (shards 2 and 6 on WebKit launch stalls, shards 1, 3, and 5 on the deterministic hangs described above, all now addressed by this branch or by main). Therelay-tlssystem-keychaincheck failed once on a runner DNS outage at checkout and passed on re-run.81cce8891b(merge of mainc1fe9f87db): CI run 35573799419 passed (Fast static checks, linux preflight, macOS compile admission); every PR check is green. Thefull-cilabel was removed on 2026-09-21 07:21 UTC, so this run used the compile-only pull-request policy and skipped the app-host shards, swift-package-tests, tests-build-and-lag, and release-build; the merge queue runs the full suite on the commit that lands. The full suite was last exercised on6f0d450afdas described above (zero host crashes; time-limit trips only). No localxcodebuildwas run for any of this.tests-build-and-lagfailure was runner DNS failure fetching Ghostty dependencies (UnknownHostName); app compilation and all six unit-test shards had passed. Current-head GitHub checks remain the authoritative result.2fa138e085738efe4fc81587, tagissue-8001-devices-review-fixes, SHA892c7655037d644e4655e651c914124f2a7bb660. The preceding build caught main's row-grid API change;892c765503updates all three Devices call sites tostyle.rowGrid. The tagged build passed and its archive name, bundle identity, digest, and HQ manifest were verified: issue-8001-devices-review-fixes. Artifact SHA-256:c63e028be5242da5a4f266aaeba20601d65255693ece28fee19bb0c73d5dbfa2. Both controller receipts retain cleanup and timing evidence.Existing feature dogfood was performed on this Mac and an Intel MacBook Pro; that earlier build does not substitute for validation of this review-fix revision. No new iOS installation is claimed.
Demo Video
No new recording for this CI/review update. The existing feature has been dogfooded; this revision's automated and build evidence is listed above.
Review Trigger
Existing automatic review bots continue on pushed commits. Review threads are answered with the fix or a concrete explanation; no additional second-model review was requested.
Checklist
Full-suite investigation (2026-09-21)
The optional full-suite label is currently removed. I audited the failed full-suite runs instead of treating every failure as a Devices regression. The broad app-host runs exercised hundreds of unchanged tests in one process and produced unrelated failures across CLI notifications, Ghostty colors, SSH/session snapshots, Dock/browser state, shortcuts, and mobile lifecycle. The deterministic mechanisms found were:
166f76ff72excludes the host process and bounds the wait.WKWebView.4c4b22daf6adds a bounded timer fallback.github.com(Could not resolve host: github.com), an infrastructure DNS failure.The supported PR run on head
1881e4c906has 39 passing checks, 8 policy skips, and only the known CLA Assistant pagination failure. The Devices-focused package/app checks and compile admission pass.