Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat(ios): ask account computers for access only when tapped
leepokai490e1c350b80
diff --git a/README.md b/README.mdindex 5ab5991d..4b0a1520 100644--- a/README.md+++ b/README.md@@ -54,7 +54,7 @@ Codync turns the coding agents on your computer — Claude Code, Codex, Cursor,- **One app per kind of device.** Native SwiftUI on the iPhone, one desktop app for Mac, Windows and Linux (Electron), and a terminal UI for SSH.- **A Grok Bot, Muse and Dots alternative.** Persistent named bots, group chats, reply threads, bots asking each other for help, approval cards, per-bot memory, remote screen, voice calls and "needs you / done" notifications — the same features, without being tied to one model or one subscription.- **Reach your computer from anywhere, free.** The hosted Cloudflare relay is included at no cost: no Tailscale, no VPN, no port forwarding. Traffic is end-to-end encrypted between your phone and your computer, so the relay only forwards ciphertext. Same Wi-Fi or Tailscale? The phone connects directly instead.-- **Every computer, one app.** Sign in and your iPhone lists every computer on your account (Mac, Windows PC, Linux desktop, server or cloud VM); tap **Connect**, confirm a 6-digit code on that computer, and its bots show up next to the others. A new bot can live on any of them, and the Mac app reaches your SSH machines too. Each computer approves each device itself, so an account alone never unlocks a computer.+- **Every computer, one app.** Sign in and your iPhone lists every computer on your account (Mac, Windows PC, Linux desktop, server or cloud VM); open Computers and tap **Ask for access**, confirm a 6-digit code on that computer, and its bots show up next to the others. A new bot can live on any of them, and the Mac app reaches your SSH machines too. Each computer approves each device itself, so an account alone never unlocks a computer.- **Remote screen.** See and control your computer from the iPhone over WebRTC (hardware H.264), and let bots use the screen themselves through the built-in `computer` tool.- **Voice calls.** Talk to a bot hands-free from the iPhone and hear its replies read aloud.- **Private push.** Notification text is sealed to your phone's key, so the push relay never sees what your bots said.diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppStore.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppStore.ktindex 6da7eb24..a85890d5 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AppStore.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppStore.kt@@ -28,7 +28,6 @@ class AppStore(application: Application) : AndroidViewModel(application) {internal var cloud: CloudClient? = nullprivate var sessionJob: Job? = nullinternal var linkJob: Job? = null- internal val asked = mutableSetOf<String>()internal var attachments = AttachmentFiles(application, local.directory)internal val downloadLocks = ConcurrentHashMap<String, Mutex>()internal val mutableState = MutableStateFlow(AppState())@@ -132,7 +131,7 @@ class AppStore(application: Application) : AndroidViewModel(application) {AccountImages.retire()channel?.close(); channel = nullconnectionJob = null; pairingJob = null; graceJob = null- actions.clear(); sends.clear(); downloadLocks.clear(); asked.clear(); cloud = null+ actions.clear(); sends.clear(); downloadLocks.clear(); cloud = nullpluginsRefreshAgain = falserewoundFor = nulldraftWriter = null; draftBook = null; savedDrafts = emptyMap()diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.ktindex 4354b01f..be468b2b 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt@@ -52,10 +52,6 @@ fun AppStore.refreshCloud() = action("cloud") {mutableState.update { it.copy(cloudComputers = computers) }// Signed in to an account with computers, before pairing any (iOS: the same moment).if (computers.isNotEmpty() && state.value.computers.isEmpty()) Analytics.completeOnboarding(OnboardingVia.Account)- // Online computers this phone has no grant on yet; a granted one needs Revoke before asking again.- val target = computers.firstOrNull { remote -> state.value.computers.isEmpty() && remote.online == true &&- remote.access != "granted" && remote.computerId !in asked }- if (target != null) requestAccess(target)} catch (error: CloudError) { if (!error.isTransient) throw error }}@@ -65,7 +61,6 @@ suspend fun AppStore.refreshComputers() { refreshCloud(); actions["cloud"]?.joinfun AppStore.requestAccess(target: CloudComputer) = action("access") {val client = requireNotNull(cloud) { "Sign in to reach your account." }require(state.value.computers.isEmpty() || state.value.computers.first().id == target.computerId) { "Forget the current computer before connecting a different one." }- asked.add(target.computerId)val ticket = client.requestAccess(target.computerId, target.signKey)Analytics.capture(AnalyticsEvent.AccessRequested)mutableState.update { it.copy(access = ticket) }@@ -137,9 +132,7 @@ fun AppStore.setColor(color: String) = action("color") {fun AppStore.forgetComputer() = sessionAction {transitions.withLock {val userId = state.value.account.userId- val id = state.value.computers.firstOrNull()?.idretireContext()- if (id != null) asked.add(id)withContext(Dispatchers.IO) {local.saveComputers(emptyList())local.directory.listFiles()?.filter { it.name.startsWith("mirror-") || it.name.startsWith("drafts-") }?.forEach { it.delete() }diff --git a/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.kt b/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.ktindex a0bec399..40d565b5 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.kt@@ -61,7 +61,7 @@ private enum class Root { Loading, Welcome, Pairing, Tabs }}}val signedIn = state.account.userId != null- // Signed in, setup counts as complete (`loadContext`): the account's computers ask for access on their own.+ // Signed in, setup counts as complete (`loadContext`): the account's computers are asked for access from Computers.val onboarding = !state.setupComplete && state.computers.isEmpty() && state.cloudComputers.isEmpty()val root = when {state.loading -> Root.Loadingdiff --git a/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.kt b/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.ktindex 951e9f9e..a164cb1e 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.kt@@ -42,7 +42,7 @@ private enum class AppTab { Bots, State }val bottom = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding()val barSpace = bottom + 62.dp + 24.dpGlassStage(Modifier.fillMaxSize(), chrome = {- // An account computer this phone asked on its own after sign-in: the code to check, until it answers.+ // An access request still waiting after its sheet closed: the code to check, until the computer answers.val ticket = state.accessAnimatedVisibility(ticket != null && state.selectedBot == null, Modifier.align(Alignment.BottomCenter).padding(bottom = barSpace - 16.dp),enter = fadeIn(Motion.fade()) + slideInVertically(Motion.layoutOffset) { it }, exit = fadeOut(Motion.fade()) + slideOutVertically(Motion.layoutOffset) { it }) {diff --git a/apps/android/app/src/main/kotlin/com/codync/android/PairingView.kt b/apps/android/app/src/main/kotlin/com/codync/android/PairingView.ktindex 08d1c19e..eab0160d 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/PairingView.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/PairingView.kt@@ -243,7 +243,7 @@ private enum class ComputerOS { Mac, Linux }"wifi.exclamationmark", Palette.secondary)}}- // Signed in, account computers show up and ask for access themselves.+ // Signed in, account computers show up in Computers, where a tap asks one for access.if (state.account.configured && state.account.userId == null) SignInButtons(state, store)// How it connects is never a choice here: every paired computer gets every route.Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift b/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swiftindex 124afbe6..6ab101d2 100644--- a/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift@@ -48,10 +48,10 @@ public final class AccountStore {/// Persisted in the context (channel route).private var saved: [Computer]private var accessPolls: [ComputerID: Task<Void, Never>] = [:]+ /// Access requests still waiting for their code, joined by a second ask.+ private var asks: [ComputerID: Task<AccessTicket, any Error>] = [:]private var isActive = trueprivate var retired = false- /// Asked once per launch: a denied or cancelled request isn't repeated behind the user's back.- private var asked: Set<ComputerID> = []public convenience init(storage: SharedStore.Context, cloud: CloudClient?) {self.init(storage: storage, cloud: cloud) { computer in@@ -142,9 +142,6 @@ public final class AccountStore {let list = try await cloud.computers()guard !retired else { return }if list != cloudComputers { Motion.animate { cloudComputers = list } }- // Signed in, ask every account computer this device can't use yet for access, without- // a tap. Computers set to auto-approve let it straight in; the others show the code.- await askForAccess()} catch let error as CloudError where !error.isTransient {lastError = error.localizedDescription} catch {@@ -154,19 +151,44 @@ public final class AccountStore {}}- /// Starts an access request; the returned `code` must match the one the computer shows.+ /// Asks the computer for access; the code arrives in `pendingAccess`, where it must match the one+ /// the computer shows. The request runs here, not in the caller: it outlives a closed sheet, so the+ /// computer never waits on a request nobody reveals, and asking again while it runs joins it+ /// instead of committing a second one./// Approval is then picked up in the background and the computer joins `stores`.- public func requestAccess(_ id: ComputerID) async throws -> AccessTicket {+ public func requestAccess(_ id: ComputerID) async throws {+ if let ask = asks[id], !ask.isCancelled {+ _ = try await ask.value+ return+ }guard let cloud, let target = cloudComputers.first(where: { $0.computerId == id }) else {throw CloudError(status: 404, code: "notFound", message: "That computer isn't in your account.")}- let ticket = try await cloud.requestAccess(id, signKey: target.signKey)- guard !retired else { throw CancellationError() }- Analytics.shared.capture(.accessRequested)- setPending(id, ticket)accessPolls[id]?.cancel()- accessPolls[id] = Task { [weak self] in await self?.awaitApproval(ticket, target: target, cloud: cloud) }- return ticket+ let ask = Task { try await cloud.requestAccess(id, signKey: target.signKey) }+ asks[id] = ask+ accessPolls[id] = Task { [weak self] in+ await withTaskCancellationHandler {+ let result = await ask.result+ guard let self else { return }+ if self.asks[id] == ask { self.asks[id] = nil }+ let ticket: AccessTicket+ do {+ ticket = try result.get()+ } catch {+ // With the sheet closed nothing else sees it; an open sheet shows it too.+ log.info("access request failed: \(error.localizedDescription, privacy: .public)")+ return+ }+ guard !self.retired, !Task.isCancelled else { return }+ Analytics.shared.capture(.accessRequested)+ self.setPending(id, ticket)+ await self.awaitApproval(ticket, target: target, cloud: cloud)+ } onCancel: {+ ask.cancel()+ }+ }+ _ = try await ask.value}/// An offline account computer named like one this device uses or sees online: most likely the same@@ -216,25 +238,6 @@ public final class AccountStore {}}- private func askForAccess() async {- let waiting = cloudComputers.filter { c in- c.isOnline && c.access != "granted" && !asked.contains(c.computerId)- && pendingAccess[c.computerId] == nil && stores[c.computerId] == nil- }- for computer in waiting {- asked.insert(computer.computerId)- do {- _ = try await requestAccess(computer.computerId)- } catch let error as CloudError where !error.isTransient {- lastError = error.localizedDescription- } catch {- // Asked without a tap: a connection or cloud hiccup isn't worth a dialog.- // The computer stays in the list, where it can be asked by hand.- log.info("access request failed: \(error.localizedDescription, privacy: .public)")- }- }- }-/// Withdraws a pending access request; the computer drops it from its approval list.public func cancelAccess(_ id: ComputerID) async {guard let ticket = pendingAccess[id] else { return }diff --git a/apps/ios/Kit/Tests/CodyncUITests/AccessRequestTests.swift b/apps/ios/Kit/Tests/CodyncUITests/AccessRequestTests.swiftnew file mode 100644index 00000000..8506006e--- /dev/null+++ b/apps/ios/Kit/Tests/CodyncUITests/AccessRequestTests.swift@@ -0,0 +1,70 @@+import CryptoKit+import Foundation+import os+import Testing+@testable import CodyncKit+@testable import CodyncUI++private let hostKey = Data(repeating: 7, count: 32)++/// One access request's cloud calls: the account lists the computer, the request is created,+/// the host's nonce is already there, the reveal is accepted; approval never comes.+private final class AccessCloudStub: URLProtocol {+ /// Access requests committed so far.+ static let commits = OSAllocatedUnfairLock(initialState: 0)++ override class func canInit(with request: URLRequest) -> Bool { true }+ override class func canonicalRequest(for request: URLRequest) -> URLRequest { request }+ override func stopLoading() {}++ override func startLoading() {+ let path = request.url?.path ?? ""+ if path.hasSuffix("/access-requests") { Self.commits.withLock { $0 += 1 } }+ let json = if path.hasSuffix("/v1/computers") {+ #"{"computers":[{"computerId":"\#(RelayCrypto.computerId(signKey: hostKey))","name":"Desk","signKey":"\#(hostKey.base64URL)","online":true}]}"#+ } else if path.hasSuffix("/access-requests") {+ #"{"requestId":"r1","expiresAt":4102444800000}"#+ } else if path.hasSuffix("/v1/access-requests/r1") {+ #"{"requestId":"r1","status":"pending","hostNonce":"\#(Data(repeating: 9, count: 32).base64URL)"}"#+ } else {+ "{}"+ }+ let response = HTTPURLResponse(url: request.url!, statusCode: 200, httpVersion: nil, headerFields: nil)!+ client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed)+ client?.urlProtocol(self, didLoad: Data(json.utf8))+ client?.urlProtocolDidFinishLoading(self)+ }+}++/// Signed in with an online computer this device can't use, nothing is asked until the user taps.+/// Closing the access sheet before the code arrives and opening it again makes one request, which+/// goes on in the store and ends with the code in the banner, not pending on the computer unrevealed.+@MainActor @Test func accessIsAskedOnlyOnTapAndOutlivesItsSheet() async throws {+ let suite = "AccessRequest.\(UUID().uuidString)"+ defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }+ let config = URLSessionConfiguration.ephemeral+ config.protocolClasses = [AccessCloudStub.self]+ let identity = DeviceIdentity(signing: .init(), push: .init())+ let cloud = CloudClient(baseURL: URL(string: "https://cloud.test")!, identity: identity,+ session: URLSession(configuration: config)) { "token" }+ let storage = SharedStore.Context(accountID: "account", suite: suite)+ let accounts = AccountStore(storage: storage, cloud: cloud)+ defer { accounts.retire() }+ await accounts.refreshCloud()+ let id = RelayCrypto.computerId(signKey: hostKey)+ #expect(accounts.cloudComputers.map(\.computerId) == [id])+ #expect(accounts.pendingAccess.isEmpty)+ #expect(AccessCloudStub.commits.withLock { $0 } == 0)++ let sheet = Task { try await accounts.requestAccess(id) }+ sheet.cancel()+ let reopened = Task { try await accounts.requestAccess(id) }++ for _ in 0..<100 where accounts.pendingAccess[id] == nil {+ try await Task.sleep(for: .milliseconds(50))+ }+ #expect(accounts.pendingAccess[id]?.requestId == "r1")+ #expect(accounts.pendingAccess[id]?.code.count == 6)+ try await reopened.value+ #expect(AccessCloudStub.commits.withLock { $0 } == 1)+}diff --git a/apps/ios/Views/AccessRequestView.swift b/apps/ios/Views/AccessRequestView.swiftindex 9c2cf654..edd9264f 100644--- a/apps/ios/Views/AccessRequestView.swift+++ b/apps/ios/Views/AccessRequestView.swift@@ -100,10 +100,12 @@ struct AccessRequestView: View {}}- /// Runs until the computer answered with its nonce; closing the sheet cancels it.+ /// Runs until the computer answered with its nonce; the code then shows through `pendingAccess`.+ /// Closing the sheet leaves the request, and this wait, running to its end with the result+ /// ignored; the code then shows in the banner.private func request() async {do {- _ = try await accounts.requestAccess(computer.computerId)+ try await accounts.requestAccess(computer.computerId)} catch is CancellationError {return} catch {diff --git a/apps/ios/Views/PairingView.swift b/apps/ios/Views/PairingView.swiftindex 64b9d804..da124e5a 100644--- a/apps/ios/Views/PairingView.swift+++ b/apps/ios/Views/PairingView.swift@@ -260,7 +260,7 @@ private struct ScanPage: View {.transition(.opacity)}- // Signed in, account computers show up and ask for access themselves.+ // Signed in, account computers show up in Computers, where a tap asks one for access.if account.isConfigured && !account.isSignedIn { SignInButtons() }// How it connects is never a choice here: every paired computer gets every route.diff --git a/apps/ios/Views/RootView.swift b/apps/ios/Views/RootView.swiftindex 4b89f959..453c5db6 100644--- a/apps/ios/Views/RootView.swift+++ b/apps/ios/Views/RootView.swift@@ -323,7 +323,7 @@ private extension View {}}-/// Account computers this iPhone asked on its own after sign-in: the code to check, until they answer.+/// Access requests still waiting after their sheet closed: the code to check, until the computer answers.private struct AccessBanners: View {@Environment(AccountStore.self) private var accountsdiff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.mdindex 4f6c32d6..aec0ef7c 100644--- a/apps/ios/WhatsNew.md+++ b/apps/ios/WhatsNew.md@@ -6,20 +6,12 @@ any left). tools/asc-submit.py reads the released version's section;a version without one gets a generic "Bug fixes and improvements" line. Delete old sections.-->-## 2.20.0+## 2.20.1### zh-Hant-- 設定 Routine 排程更簡單:選擇每小時、每天、平日或每週,再挑時間就好;需要更細的排程時,仍可用「自訂」直接輸入 cron。-- 時區改成可搜尋的清單,打幾個字就能找到,預設是你目前所在的時區。-- 新版本一上架,更新提醒就會出現,不再晚上一天。-- 使用分析現在也會記錄你開啟哪些畫面、設定與配對走到哪一步,以及是否允許通知,讓我們看出大家在哪裡卡住。仍然不會記錄你的訊息、程式碼或檔案,隨時可以在設定裡關閉。-- 背景時更可靠地送出使用分析,切出 App 也不會漏掉。+- 登入後不會再自動向帳號裡的電腦要求存取,也不會直接跳出驗證碼;在「電腦」裡點「Ask for access」才會開始。### en-US-- Setting a routine's schedule is simpler: pick hourly, daily, weekdays or weekly, then the time. Custom still takes a cron for anything finer.-- Time zones come from a searchable list, found in a few keystrokes, starting from the one you're in.-- The update reminder shows up as soon as a new version is in the App Store, not a day later.-- Usage analytics now also count which screens you open, how far setup and pairing get, and whether you allow notifications, so we can see where people get stuck. Never your messages, code or files, and you can still turn it off in Settings.-- Usage analytics are sent more reliably when you leave the app.+- Signing in no longer asks your account's computers for access on its own or jumps straight to a code; it starts when you tap Ask for access in Computers.diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.mdindex 4d3133cc..f4f41d46 100644--- a/docs/design/ui-conventions.md+++ b/docs/design/ui-conventions.md@@ -10,7 +10,7 @@ iPhone conversation scrolling leaves dragging, deceleration, and bottom rubber-bDo not wrap those toolbar controls in `IconButtonStyle`, hand-sized rounded backgrounds or another glass effect. The account avatar is toolbar content, with the system supplying the enclosing surface. This is the explicit exception to the custom-chrome rule below.-Connecting and reconnecting are background work. `BotStore` gives initial offline reports 1 second to recover and holds drops from online (including relay "computer offline" reports) for 5 seconds. "No access" shows immediately. Automatic read acknowledgements never open an error dialog and visible conversations are acknowledged again after reconnecting. An action taken during a reconnect (back in the foreground, a new network, a drop still inside its grace) waits for the link, up to 20 seconds, instead of failing; while one waits, headers read `Connecting…` and the conversation's connection label shows a spinner. Calls that are safe to repeat (send, stop, approvals, pin, hide, mark as read, delete) are tried again when the link drops under them. Tapping while the header says Offline because the computer can't be reached starts a fresh connection attempt and waits for it, instead of failing until the backoff gets there; a computer the relay reports as off fails at once, since the relay says when it is back. A permission card shows a spinner on the chosen option, dims the others and takes no second answer until the computer has it. The desktop app's `BotStore` (link handling in `apps/desktop/src/renderer/store/bot-sync.ts`) applies the same graces and 20-second wait. The TUI follows the same rule over loopback: a command the host can't be reached for is retried for up to 20 seconds behind its "Reconnecting…" indicator (the `hello` probe that explains an unreachable host still answers at once), and its permission cards spin on the chosen option. The "Something went wrong" dialog is left for a computer that is off, a refused device, the computer's own answers, and reconnects that outlast the wait. Background work (cloud refresh, device registration, automatic access requests) logs connection, busy-cloud and stale-token failures instead of showing them. The iOS app disconnects only in `.background`, not `.inactive`. Connection status lives only in headers and their menus. The roster header shows a small summary (`1 connected`, `1/2 connected`, `2 offline`, or `Connecting…`). Its computer menu supports multiple selections, Show only, All computers, reconnect, and management. At least one available computer stays selected; if saved exclusions would hide every computer, the list falls back to all. Filters persist on the device. Bots sort pinned first, then in the order the user dragged them into, then by recency ([bot order](../features/computer-order.md#bot-order)). On iPhone, when more than one computer is shown, each computer gets a light heading (badge, name, connection, and "No bots yet" when empty) above its own bots; with one computer the list stays flat. Tapping a heading folds that computer's bots away (chevron; saved on the device). Long-press a heading to lift the whole section and drag it up or down; the other sections slide out of its way and the order is saved on the device on release (`AccountStore.move`; VoiceOver: Move up / Move down). The desktop app shows a flat roster. There are no connection banners. The compact desktop rail uses a computer icon for the same menu. Conversation headers show a small connection label, with the computer name available in the header menu or help text. Pull-to-refresh remains available on iPhone. Computer setup and access requests live under Manage computers.+Connecting and reconnecting are background work. `BotStore` gives initial offline reports 1 second to recover and holds drops from online (including relay "computer offline" reports) for 5 seconds. "No access" shows immediately. Automatic read acknowledgements never open an error dialog and visible conversations are acknowledged again after reconnecting. An action taken during a reconnect (back in the foreground, a new network, a drop still inside its grace) waits for the link, up to 20 seconds, instead of failing; while one waits, headers read `Connecting…` and the conversation's connection label shows a spinner. Calls that are safe to repeat (send, stop, approvals, pin, hide, mark as read, delete) are tried again when the link drops under them. Tapping while the header says Offline because the computer can't be reached starts a fresh connection attempt and waits for it, instead of failing until the backoff gets there; a computer the relay reports as off fails at once, since the relay says when it is back. A permission card shows a spinner on the chosen option, dims the others and takes no second answer until the computer has it. The desktop app's `BotStore` (link handling in `apps/desktop/src/renderer/store/bot-sync.ts`) applies the same graces and 20-second wait. The TUI follows the same rule over loopback: a command the host can't be reached for is retried for up to 20 seconds behind its "Reconnecting…" indicator (the `hello` probe that explains an unreachable host still answers at once), and its permission cards spin on the chosen option. The "Something went wrong" dialog is left for a computer that is off, a refused device, the computer's own answers, and reconnects that outlast the wait. Background work (cloud refresh, device registration) logs connection, busy-cloud and stale-token failures instead of showing them. The iOS app disconnects only in `.background`, not `.inactive`. Connection status lives only in headers and their menus. The roster header shows a small summary (`1 connected`, `1/2 connected`, `2 offline`, or `Connecting…`). Its computer menu supports multiple selections, Show only, All computers, reconnect, and management. At least one available computer stays selected; if saved exclusions would hide every computer, the list falls back to all. Filters persist on the device. Bots sort pinned first, then in the order the user dragged them into, then by recency ([bot order](../features/computer-order.md#bot-order)). On iPhone, when more than one computer is shown, each computer gets a light heading (badge, name, connection, and "No bots yet" when empty) above its own bots; with one computer the list stays flat. Tapping a heading folds that computer's bots away (chevron; saved on the device). Long-press a heading to lift the whole section and drag it up or down; the other sections slide out of its way and the order is saved on the device on release (`AccountStore.move`; VoiceOver: Move up / Move down). The desktop app shows a flat roster. There are no connection banners. The compact desktop rail uses a computer icon for the same menu. Conversation headers show a small connection label, with the computer name available in the header menu or help text. Pull-to-refresh remains available on iPhone. Computer setup and access requests live under Manage computers; a phone asks an account computer for access only when the user taps Ask for access, never on its own.Sources: `apps/ios/Views/BotListView.swift`, `AccountSwitcherView.swift`, `apps/ios/Kit/Sources/CodyncUI/Thread/ThreadView.swift`, `Bots/ComputerFilterHeader.swift`, `Store/ComputerSelection.swift`, `Bots/BotRow.swift`; desktop: `apps/desktop/src/renderer/views/ChatWindow.tsx`, `ComputerFilterHeader.tsx`, `BotRow.tsx`.diff --git a/docs/reference/remote-relay.md b/docs/reference/remote-relay.mdindex fa19ce14..7c029ecb 100644--- a/docs/reference/remote-relay.md+++ b/docs/reference/remote-relay.md@@ -168,7 +168,7 @@ codync://pair?v=3&name=<pct>&id=<computerId>&sk=<signPub>&bk=<boxPub>&code=<pair**B. 手機取得存取權**(commit-then-reveal SAS,ZRTP/BLE numeric comparison 同型):1. 手機登入後 `POST /v1/devices`(Clerk + 該 device key 的 `Codync-Sig`)。-2. `GET /v1/computers`(帶 `Codync-Sig` 則回傳每台的 `access`)。 iPhone 的 Bots 首頁直接列出尚未連線的帳號電腦,點 **Connect** 進入存取申請,不需掃 QR Code;核准後顯示該電腦的 bots。首次裝置授權仍由電腦上的使用者確認。+2. `GET /v1/computers`(帶 `Codync-Sig` 則回傳每台的 `access`)。 手機在「電腦與設定」(Computers)列出帳號裡的電腦,不需掃 QR Code;存取申請只在使用者點該電腦的 **Ask for access** 後才開始(登入或重新整理都不會自動申請),點下後才顯示 6 位數代碼;關閉申請畫面後,等待中的申請仍以橫幅顯示代碼,直到電腦回應。核准後顯示該電腦的 bots。首次裝置授權仍由電腦上的使用者確認。3. 對 `access == "none"` 的電腦:手機產生 32 random bytes `nD`(只存記憶體),`POST /v1/computers/{id}/access-requests {"commit": b64url(SHA-256("codync/sascommit/v1" ‖ dk ‖ nD))}` → `{requestId, expiresAt}`。4. Worker 通知 DO → host 拉 state → 看到新申請(含 `commit`)→ host 產生 32 random bytes `nH`(存本機記憶體,每個 requestId 只產生一次)→ `POST /v1/host/access-requests/{id}/nonce {"nonce": nH}`(已有 host nonce → `409 conflict`,host 不得換)。5. 手機輪詢 `GET /v1/access-requests/{id}`(每 2 秒)→ 出現 `hostNonce` 後才 `POST /v1/access-requests/{id}/reveal {"nonce": nD}` → Worker 存入並通知 DO `cloud.changed`。手機此時計算 SAS 顯示「在電腦上確認代碼 123456」。