Skip to content

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.

fix: show a computer as updating while it restarts for an update from the phone

leepokai587125671a00
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreHostUpdate.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreHostUpdate.kt
index e122941e..5cfd6ef7 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreHostUpdate.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreHostUpdate.kt
@@ -1,6 +1,7 @@
package com.codync.android
import com.codync.android.core.AppVersion
+import com.codync.android.core.LinkState
import com.codync.android.core.VersionMismatch
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.flow.update
@@ -24,6 +25,12 @@ internal val AppState.canUpdateHost get() = hello?.get("canUpdate")?.jsonPrimiti
/** A requested update still within its wait: the computer is updating. */
internal fun HostUpdate?.updating(now: Long) = this is HostUpdate.Requested && now - at < HOST_UPDATE_WAIT_MS
+/**
+ * Out of reach while an update asked from here installs (iOS `BotStore.isUpdating`): the computer restarts on its own,
+ * so it reads as updating, not as a lost connection or access to ask for.
+ */
+internal val AppState.isUpdating get() = connection !is LinkState.Ready && hostUpdate.updating(System.currentTimeMillis())
+
/** What the notice says about a computer that's behind, and whether it offers Update now. */
internal data class HostUpdateNotice(val detail: String, val offersUpdate: Boolean)
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt b/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt
index e88fc208..4fee39c9 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt
@@ -131,7 +131,8 @@ private fun CardRows.computerRows(state: AppState, store: AppStore, inAccount: B
}
}
row { ConnectionRow(state.computers.first(), store) }
- if (state.connection is LinkState.Ready && state.hello != null) row { CodyncVersionRow(state, store::requestHostUpdate) }
+ // Kept while an update asked from here restarts the computer: its spinner says it's updating.
+ if ((state.connection is LinkState.Ready || state.isUpdating) && state.hello != null) row { CodyncVersionRow(state, store::requestHostUpdate) }
if (state.isStale && !inAccount) row { RowLabel("Remove", "trash", Palette.danger, modifier = Modifier.plainButton(action = actions.remove)) }
}
@@ -160,7 +161,7 @@ private fun CardRows.computerRows(state: AppState, store: AppStore, inAccount: B
Text(state.hello?.text("name") ?: computer.name, Modifier.weight(1f), style = Type.body.semibold, color = Palette.text)
if (inAccount) Symbol("person.crop.circle.badge.checkmark", size = 20.dp, tint = Palette.tertiary, contentDescription = "In your account")
}
- val unreachable = link is LinkState.ComputerOffline || link is LinkState.Failed
+ val unreachable = (link is LinkState.ComputerOffline || link is LinkState.Failed) && !state.isUpdating
Text(detail, style = Type.footnote, color = if (unreachable) Palette.warning else Palette.secondary)
if (unreachable && actions.ask != null) {
SecondaryButton(if (state.access?.computerId == computer.id) "Show code" else "Ask for access", action = actions.ask)
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/ConnectionPresentation.kt b/apps/android/app/src/main/kotlin/com/codync/android/ConnectionPresentation.kt
index 6bdcad84..de3e1ef3 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/ConnectionPresentation.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/ConnectionPresentation.kt
@@ -14,7 +14,7 @@ import com.codync.android.core.Pairing
private val LinkState.unauthorized get() = this is LinkState.Failed && status == 403
/** One short line for the computer's connection, next to its name (iOS `BotStore.statusText`). */
-internal fun statusText(state: AppState): String = if (state.computers.isEmpty()) "Not paired" else when (val link = state.connection) {
+internal fun statusText(state: AppState): String = if (state.computers.isEmpty()) "Not paired" else if (state.isUpdating) "Updating…" else when (val link = state.connection) {
is LinkState.Ready -> if (state.mismatch != null) "Needs update" else "Online"
LinkState.Connecting -> "Connecting…"
is LinkState.ComputerOffline -> link.lastSeenAt?.let { "Offline · seen ${RelativeTime.day(it)}" } ?: "Offline"
diff --git a/apps/android/app/src/test/kotlin/com/codync/android/ConnectionPresentationTest.kt b/apps/android/app/src/test/kotlin/com/codync/android/ConnectionPresentationTest.kt
index 8e335001..d6a446b3 100644
--- a/apps/android/app/src/test/kotlin/com/codync/android/ConnectionPresentationTest.kt
+++ b/apps/android/app/src/test/kotlin/com/codync/android/ConnectionPresentationTest.kt
@@ -51,6 +51,16 @@ class ConnectionPresentationTest {
assertEquals("Offline · seen ${RelativeTime.day(seen)}", statusText(state(LinkState.ComputerOffline(seen))))
}
+ @Test fun aComputerRestartingForAnUpdateAskedHereReadsAsUpdating() {
+ val asked = HostUpdate.Requested(System.currentTimeMillis())
+ val restarting = state(LinkState.Failed("Connection closed.")).copy(hostUpdate = asked)
+ assertTrue(restarting.isUpdating)
+ assertEquals("Updating…", statusText(restarting))
+ assertFalse(state(LinkState.Ready(HostRoute.Direct)).copy(hostUpdate = asked).isUpdating)
+ val longAgo = HostUpdate.Requested(System.currentTimeMillis() - HOST_UPDATE_WAIT_MS - 1)
+ assertEquals("Can't reach", statusText(restarting.copy(hostUpdate = longAgo)))
+ }
+
@Test fun aComputerBehindTheAppNeedsAnUpdate() {
val online = state(LinkState.Ready(HostRoute.Direct)).copy(hello = buildJsonObject { put("version", "2.0.0"); put("minApp", "2.0.0") })
assertEquals("Needs update", statusText(online))
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json
index 91f476db..5e845c57 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json
@@ -49,6 +49,7 @@
"Connects on Wi-Fi, over Tailscale, or from anywhere through Cloudflare, on its own. End-to-end encrypted.": "Verbindet sich allein über WLAN, über Tailscale oder von überall über Cloudflare. Ende-zu-Ende verschlüsselt.",
"Connecting": "Verbindung wird hergestellt",
"Connecting…": "Verbindung wird hergestellt…",
+ "Updating…": "Wird aktualisiert…",
"Connection": "Verbindung",
"Continue": "Weiter",
"Continue with Apple": "Weiter mit Apple",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json
index f493fd2f..19a4743b 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json
@@ -49,6 +49,7 @@
"Connects on Wi-Fi, over Tailscale, or from anywhere through Cloudflare, on its own. End-to-end encrypted.": "Se conecta por Wi-Fi, a través de Tailscale o desde cualquier lugar a través de Cloudflare, por sí solo. Cifrado de extremo a extremo.",
"Connecting": "Conectando",
"Connecting…": "Conectando…",
+ "Updating…": "Actualizando…",
"Connection": "Conexión",
"Continue": "Continuar",
"Continue with Apple": "Continuar con Apple",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json
index 7a15b488..ecaee33a 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json
@@ -49,6 +49,7 @@
"Connects on Wi-Fi, over Tailscale, or from anywhere through Cloudflare, on its own. End-to-end encrypted.": "Se connecte seul en Wi-Fi, via Tailscale ou depuis n'importe où via Cloudflare. Chiffré de bout en bout.",
"Connecting": "Connexion",
"Connecting…": "Connexion…",
+ "Updating…": "Mise à jour…",
"Connection": "Connexion",
"Continue": "Continuer",
"Continue with Apple": "Continuer avec Apple",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json
index a0f2acb2..086140d0 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json
@@ -49,6 +49,7 @@
"Connects on Wi-Fi, over Tailscale, or from anywhere through Cloudflare, on its own. End-to-end encrypted.": "Wi-Fi、Tailscale経由、またはCloudflare経由でどこからでも単独で接続します。エンドツーエンドで暗号化されます。",
"Connecting": "接続中",
"Connecting…": "接続中…",
+ "Updating…": "アップデート中…",
"Connection": "接続",
"Continue": "続ける",
"Continue with Apple": "Appleで続ける",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json
index f4734786..bdb371a8 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json
@@ -49,6 +49,7 @@
"Connects on Wi-Fi, over Tailscale, or from anywhere through Cloudflare, on its own. End-to-end encrypted.": "Wi-Fi, Tailscale 또는 Cloudflare를 통해 어디서나 자체적으로 연결됩니다. 엔드투엔드 암호화.",
"Connecting": "연결 중",
"Connecting…": "연결 중…",
+ "Updating…": "업데이트 중…",
"Connection": "연결",
"Continue": "계속",
"Continue with Apple": "Apple로 계속",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json
index 1073c1ed..803e6e42 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json
@@ -49,6 +49,7 @@
"Connects on Wi-Fi, over Tailscale, or from anywhere through Cloudflare, on its own. End-to-end encrypted.": "会自己走 Wi-Fi、Tailscale,或经 Cloudflare 从任何地方连接。端到端加密。",
"Connecting": "正在连接",
"Connecting…": "正在连接…",
+ "Updating…": "正在更新…",
"Connection": "连接",
"Continue": "继续",
"Continue with Apple": "通过 Apple 继续",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json
index 9528e6dc..72665bb6 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json
@@ -49,6 +49,7 @@
"Connects on Wi-Fi, over Tailscale, or from anywhere through Cloudflare, on its own. End-to-end encrypted.": "會自己走 Wi-Fi、Tailscale,或經 Cloudflare 從任何地方連線。端到端加密。",
"Connecting": "正在連線",
"Connecting…": "正在連線…",
+ "Updating…": "正在更新…",
"Connection": "連線",
"Continue": "繼續",
"Continue with Apple": "透過 Apple 繼續",
diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+HostUpdate.swift b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+HostUpdate.swift
index a9d13d92..939dd810 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+HostUpdate.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+HostUpdate.swift
@@ -75,6 +75,10 @@ extension BotStore {
/// While it updates, `hello` is asked this often, so the notice goes away soon after.
static let updatingRecheck: Duration = .seconds(5)
+ /// Out of reach while an update asked from here installs: the computer restarts on its own, so it
+ /// reads as updating, not as a lost connection or access to ask for.
+ public var isUpdating: Bool { connection != .online && hostUpdateOffer() == .updating }
+
public func hostUpdateOffer(now: Date = .now) -> HostUpdateOffer {
if case let .requested(at) = hostUpdate, now.timeIntervalSince(at) < Self.hostUpdateWait { return .updating }
return hello?.canUpdate == true ? .available(last: hostUpdate) : .unavailable
diff --git a/apps/ios/Views/BotListView.swift b/apps/ios/Views/BotListView.swift
index 9cd5dfd2..7a10ec87 100644
--- a/apps/ios/Views/BotListView.swift
+++ b/apps/ios/Views/BotListView.swift
@@ -393,7 +393,7 @@ private struct ComputerSection: View {
Spacer(minLength: 8)
Text(L10n.tr(store.statusText))
.font(.footnote)
- .foregroundStyle(store.isOffline ? Palette.warning : Palette.tertiary)
+ .foregroundStyle(store.isOffline && !store.isUpdating ? Palette.warning : Palette.tertiary)
.lineLimit(1)
.contentTransition(.opacity)
if store.connection == .online {
diff --git a/apps/ios/Views/ComputerStatus.swift b/apps/ios/Views/ComputerStatus.swift
index e9842ba7..eea4cc38 100644
--- a/apps/ios/Views/ComputerStatus.swift
+++ b/apps/ios/Views/ComputerStatus.swift
@@ -5,7 +5,8 @@ import SwiftUI
extension BotStore {
/// One short line for a computer's connection, used next to its name.
var statusText: String {
- switch connection {
+ if isUpdating { return "Updating…" }
+ return switch connection {
case .online where mismatch != nil: "Needs update"
case .online: "Online"
case .connecting: "Connecting…"
diff --git a/apps/ios/Views/ComputersView.swift b/apps/ios/Views/ComputersView.swift
index f4fda109..042a0cdf 100644
--- a/apps/ios/Views/ComputersView.swift
+++ b/apps/ios/Views/ComputersView.swift
@@ -179,7 +179,8 @@ private struct ComputerRows: View {
}
.toggleStyle(.codync)
connection
- if store.connection == .online, store.hello != nil {
+ // Kept while an update asked from here restarts the computer: its spinner says it's updating.
+ if store.connection == .online || store.isUpdating, store.hello != nil {
CodyncVersionRow(store: store)
}
if accounts.isStale(store.computer.id), inAccount == nil {
@@ -202,7 +203,7 @@ private struct ComputerRows: View {
}
}
connectionDetail
- if store.isOffline, let ask {
+ if store.isOffline, !store.isUpdating, let ask {
Button(accounts.pendingAccess[store.computer.id] == nil ? "Ask for access" : "Show code", action: ask)
.buttonStyle(.secondary)
}
@@ -271,7 +272,7 @@ private struct ComputerRows: View {
private var connectionDetail: some View {
Text(L10n.tr(detail)).font(.footnote)
- .foregroundStyle(store.isOffline ? Palette.warning : Palette.secondary)
+ .foregroundStyle(store.isOffline && !store.isUpdating ? Palette.warning : Palette.secondary)
.fixedSize(horizontal: false, vertical: true)
}
diff --git a/web/content/docs/updates.mdx b/web/content/docs/updates.mdx
index 6ae961fb..dbdc6074 100644
--- a/web/content/docs/updates.mdx
+++ b/web/content/docs/updates.mdx
@@ -47,7 +47,7 @@ A manual update won't interrupt a bot that's working unless you add `--force`; i
## A computer's version and its update
-On the iPhone, tap the connection status at the top of the Bots tab (such as **1 connected**), choose **Manage computers**, and look at **Codync** at the bottom of the computer's card. It shows the version that computer runs, and says **Up to date** or which newer version is available. Tap **Update** to have the computer download it and restart into it, usually within a few minutes; the row says it's updating until the computer is back. It's the same update as **Update now** on the notice [below](#when-the-phone-and-computer-versions-dont-match), with the same rules: a computer doesn't update while a bot is working on it, and a Mac or Windows computer updates this way while the Codync app is open on it. When the computer can't be updated from your phone, the row says how to do it there.
+On the iPhone, tap the connection status at the top of the Bots tab (such as **1 connected**), choose **Manage computers**, and look at **Codync** at the bottom of the computer's card. It shows the version that computer runs, and says **Up to date** or which newer version is available. Tap **Update** to have the computer download it and restart into it, usually within a few minutes; the row says it's updating until the computer is back. While it restarts, the computer reads **Updating…** instead of offline, and its card doesn't ask for access. It's the same update as **Update now** on the notice [below](#when-the-phone-and-computer-versions-dont-match), with the same rules: a computer doesn't update while a bot is working on it, and a Mac or Windows computer updates this way while the Codync app is open on it. When the computer can't be updated from your phone, the row says how to do it there.
A Windows computer shows only its version there, with **Update** only when this app needs a newer Codync; otherwise it updates with its desktop app. A host installed with Homebrew also shows only its version: update it with `brew` ([above](#the-host-on-its-own)).