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: load an agent's own lists again when the computer reconnects

leepokai461d1ab77541
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AgentBrings.kt b/apps/android/app/src/main/kotlin/com/codync/android/AgentBrings.kt
index 96837542..52c565c2 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/AgentBrings.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/AgentBrings.kt
@@ -58,11 +58,13 @@ private fun JsonObject.gearItems(key: String): List<GearItem> {
}
/** Skills, connectors, rules and plugins the agent already has, under Sign in on its sheet. */
-@Composable internal fun AgentBrings(backendId: String, store: AppStore) {
+@Composable internal fun AgentBrings(backendId: String, store: AppStore, online: Boolean) {
var gear by remember(backendId) { mutableStateOf<AgentGear?>(null) }
var failed by remember(backendId) { mutableStateOf(false) }
var open by remember(backendId) { mutableStateOf<String?>(null) }
- LaunchedEffect(backendId) {
+ // Loaded again when the computer comes back online, so a failed load doesn't stay.
+ LaunchedEffect(backendId, online) {
+ if (!online) return@LaunchedEffect
try {
gear = store.agentGear(backendId)
failed = false
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AgentSheet.kt b/apps/android/app/src/main/kotlin/com/codync/android/AgentSheet.kt
index e9ed3c57..f14e4b5d 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/AgentSheet.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/AgentSheet.kt
@@ -35,6 +35,7 @@ import androidx.compose.ui.unit.dp
import com.codync.android.core.AgentAuth
import com.codync.android.core.AgentAuthMethod
import com.codync.android.core.AgentBackend
+import com.codync.android.core.LinkState
import com.codync.android.core.WireJson
import com.codync.android.design.*
import com.kyant.shapes.Capsule
@@ -176,7 +177,7 @@ internal fun agentRegistry(state: AppState, agent: String) = agentBackends(state
}
}
}
- AgentBrings(backend.id, store)
+ AgentBrings(backend.id, store, state.connection is LinkState.Ready)
error?.let { CardSection { row { SelectionContainer { ErrorRow(it) } } } }
}
}
diff --git a/apps/desktop/src/renderer/views/marketplace/AgentBrings.tsx b/apps/desktop/src/renderer/views/marketplace/AgentBrings.tsx
index e07108b6..a56314b0 100644
--- a/apps/desktop/src/renderer/views/marketplace/AgentBrings.tsx
+++ b/apps/desktop/src/renderer/views/marketplace/AgentBrings.tsx
@@ -19,8 +19,11 @@ export function AgentBrings({ backendId }: { backendId: string }) {
const [gear, setGear] = useState<Gear | null>(null)
const [failed, setFailed] = useState(false)
const [open, setOpen] = useState<string | null>(null)
+ // Loaded again when the computer comes back online, so a failed load doesn't stay.
+ const online = store.connection.kind === 'online'
useEffect(() => {
+ if (!online) return
let cancel = false
setGear(null)
setFailed(false)
@@ -30,7 +33,7 @@ export function AgentBrings({ backendId }: { backendId: string }) {
if (!cancel) setFailed(true)
})
return () => { cancel = true }
- }, [store, backendId])
+ }, [store, backendId, online])
if (failed) {
return <CardSection><Text size="footnote" tone="danger">{tr("Couldn't load what this agent brings.")}</Text></CardSection>
diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentBrings.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentBrings.swift
index 824249a8..f387a58d 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentBrings.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentBrings.swift
@@ -31,7 +31,8 @@ struct AgentBrings: View {
}
}
}
- .task(id: backendId) { await load() }
+ // Loaded again when the computer comes back online, so a failed load doesn't stay.
+ .task(id: [backendId, model.connection == .online ? "online" : "waiting"]) { await load() }
}
@ViewBuilder private func row(_ title: String, _ items: [AgentGearItem], _ open: Binding<Bool>) -> some View {
@@ -88,6 +89,7 @@ struct AgentBrings: View {
}
private func load() async {
+ guard model.connection == .online else { return }
failed = false
gear = nil
do {