Commit 59bc671
iOS: registry-driven auto-attach (sign in → connected)
A signed-in phone whose team has one reachable Mac now connects on the
cold-start path with no QR scan or manual host entry. The attach ticket is
route-discovery only; the Mac authorizes the mint purely on matching Stack
account, so a registry route + Stack token is sufficient (no prior pairing).
- MobileAutoAttachTargetSelector: pure target picker (online-preferred, else
single most-recently-seen with a reachable route; ambiguity → nil → manual).
- MobileAttachRoutePriority: shared route-priority helper (single source of
truth for reconnect, switch, device-tree tap, auto-attach).
- MobileAutoAttachFlag: mobileAutoAttach flag, DEBUG on / Release off, override
via cmux.mobile.autoAttach.enabled.
- attemptAutoAttachIfEligible chains from the no-stored-mac reconnect branch;
bounded, cancellable, one attempt per generation; reuses connectToRegistryInstance
(Stack-authenticated mint + paired-mac persist) so the next launch takes the
normal reconnect path.
- Presence seam optional (MobileAutoAttachPresenceProviding); degrades to
recency until presence (#5792) lands.
Tests: pure selector (online>recency, no-candidate, ambiguity) + composite
behavior (connects+persists, fall-through, one-attempt-per-generation, flag off,
already-connected). swift test green for CmuxMobileShellModel and CmuxMobileShell;
iOS simulator arm64 build succeeds.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0b82dfe commit 59bc671
9 files changed
Lines changed: 1994 additions & 25 deletions
File tree
- Packages
- CmuxMobileShellModel
- Sources/CmuxMobileShellModel
- Tests/CmuxMobileShellModelTests
- CmuxMobileShell
- Sources/CmuxMobileShell
- Tests/CmuxMobileShellTests
- plans/feat-ios-auto-attach
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Lines changed: 443 additions & 23 deletions
Large diffs are not rendered by default.
0 commit comments