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.

feat(apps): keep custom icons for bots only

leepokai6d432e8851d4
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 1e1fa392..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
@@ -112,7 +112,6 @@ internal fun agentRegistry(state: AppState, agent: String) = agentBackends(state
val curated = backend.curated
val setUp = setUp(backend, auth)
CardForm {
- CardSection { row { CustomIconEditor("agent:${backend.id}", state, store) } }
CardSection {
row {
Row(Modifier.padding(vertical = 4.dp), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(14.dp)) {
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/CustomIconEditor.kt b/apps/android/app/src/main/kotlin/com/codync/android/CustomIconEditor.kt
index c37a7c30..ee3804e6 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/CustomIconEditor.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/CustomIconEditor.kt
@@ -15,15 +15,6 @@ import androidx.compose.ui.unit.dp
import com.codync.android.core.*
import com.codync.android.design.*
-internal val LocalAgentIconOverrides = staticCompositionLocalOf<Map<String, CustomIcon>> { emptyMap() }
-
-internal fun agentIconOverrides(state: AppState): Map<String, CustomIcon> = buildMap {
- for (agent in agentBackends(state)) state.icons["agent:${agent.id}"]?.let { icon ->
- put(agent.id, icon)
- agent.registry?.let { put(it, icon) }
- }
-}
-
@Composable internal fun CustomIconEditor(target: String, state: AppState, store: AppStore) {
if (state.hello?.containsKey("icons") != true) return
var needsSignIn by remember { mutableStateOf(false) }
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/MainActivity.kt b/apps/android/app/src/main/kotlin/com/codync/android/MainActivity.kt
index 4f9df6aa..c5ce7c4d 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/MainActivity.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/MainActivity.kt
@@ -68,7 +68,6 @@ class MainActivity : ComponentActivity() {
val phrases = remember(appLanguage, systemTag) { AppLanguageStore.phrases(applicationContext, appLanguage, systemTag) }
val systemChinese = remember(systemTag) { systemScript(systemTag) != null }
CompositionLocalProvider(
- LocalAgentIconOverrides provides agentIconOverrides(state),
LocalNetworkImages provides images,
LocalAppLanguage provides appLanguage,
LocalSystemChinese provides systemChinese,
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/MarketRows.kt b/apps/android/app/src/main/kotlin/com/codync/android/MarketRows.kt
index 9928d1a5..f9235330 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/MarketRows.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/MarketRows.kt
@@ -95,8 +95,6 @@ import com.kyant.shapes.RoundedRectangle
/** A coding agent's logo by ACP registry id, in its brand color when it has one; a terminal glyph otherwise. */
@Composable internal fun AgentIcon(registry: String?, size: Dp) {
- val custom = LocalAgentIconOverrides.current[registry]
- if (StaticCustomIcon(custom?.dataUrl, custom?.tinted == true, size)) return
val tint = AGENT_TINTS[registry]?.let { Color(it) } ?: Palette.text
val res = agentIconRes(registry)
if (res != null) Image(painterResource(res), null, Modifier.size(size).clearAndSetSemantics {}, colorFilter = ColorFilter.tint(tint))
diff --git a/apps/desktop/src/renderer/components/AgentIcon.tsx b/apps/desktop/src/renderer/components/AgentIcon.tsx
index 8610edf2..d4e0fb15 100644
--- a/apps/desktop/src/renderer/components/AgentIcon.tsx
+++ b/apps/desktop/src/renderer/components/AgentIcon.tsx
@@ -1,5 +1,5 @@
import { Icon } from './Icon'
-import { CustomIcon, useAgentIcon } from './CustomIcon'
+import './agent-icon.css'
// Agents' logos by ACP registry id, or by Codync's id for agents outside the registry
// (template images: drawn in the current color).
@@ -10,22 +10,9 @@ export function agentIconURL(registry: string | null | undefined) {
return registry ? (byId.get(registry) ?? null) : null
}
-/** An agent's logo from the ACP registry, or a generic terminal when it has none. */
+/** An agent's logo from the ACP registry, or a generic terminal when it has none. `color` may be a gradient. */
export function AgentIcon({ registry, size, color = 'currentColor' }: { registry?: string | null; size: number; color?: string }) {
- const custom = useAgentIcon(registry)
- return <CustomIcon icon={custom} size={size} color={color} fallback={<BundledIcon registry={registry} size={size} color={color} />} />
-}
-
-function BundledIcon({ registry, size, color }: { registry?: string | null; size: number; color: string }) {
const url = agentIconURL(registry)
if (!url) return <Icon name="terminal" size={size * 0.8} scaled={false} color={color} />
- return (
- <span
- aria-hidden
- style={{
- display: 'inline-block', width: size, height: size, flex: 'none', backgroundColor: color,
- WebkitMaskImage: `url("${url}")`, WebkitMaskSize: 'contain', WebkitMaskRepeat: 'no-repeat', WebkitMaskPosition: 'center',
- }}
- />
- )
+ return <span aria-hidden className="agent-icon" style={{ width: size, height: size, background: color, WebkitMaskImage: `url("${url}")` }} />
}
diff --git a/apps/desktop/src/renderer/components/CustomIcon.tsx b/apps/desktop/src/renderer/components/CustomIcon.tsx
index f0adb7d1..1a2d7200 100644
--- a/apps/desktop/src/renderer/components/CustomIcon.tsx
+++ b/apps/desktop/src/renderer/components/CustomIcon.tsx
@@ -1,13 +1,5 @@
-import { useContext, useState, type ReactNode } from 'react'
+import { useState, type ReactNode } from 'react'
import { validIcon, type CustomIcon as IconData } from '@shared/custom-icons'
-import { StoreContext } from '../store/context'
-import { useModel } from '../lib/observable'
-
-export function useAgentIcon(registry?: string | null) {
- const store = useModel(useContext(StoreContext))
- const backend = store?.hello?.backends.find((b) => b.id === registry || b.registry === registry)
- return store?.icons[`agent:${backend?.id ?? registry}`]
-}
/** Static normalized image, including when the bot is working. */
export function CustomIcon({ icon, size, color = 'currentColor', fallback }: {
diff --git a/apps/desktop/src/renderer/components/agent-icon.css b/apps/desktop/src/renderer/components/agent-icon.css
new file mode 100644
index 00000000..e0ac6f79
--- /dev/null
+++ b/apps/desktop/src/renderer/components/agent-icon.css
@@ -0,0 +1,8 @@
+/* An agent's logo as a mask over its color (which can be a gradient, as agentTint's are). */
+.agent-icon {
+ display: inline-block;
+ flex: none;
+ -webkit-mask-size: contain;
+ -webkit-mask-repeat: no-repeat;
+ -webkit-mask-position: center;
+}
diff --git a/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx b/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx
index 4aee86c5..aa5a4bd3 100644
--- a/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx
+++ b/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx
@@ -1,6 +1,6 @@
import { useEffect, useRef, useState, type ReactNode } from 'react'
import type { Backend } from '@shared/models'
-import { agentIconURL } from '../../components/AgentIcon'
+import { AgentIcon } from '../../components/AgentIcon'
import { Button, CardForm, CardSection, IconButton, Spinner } from '../../components/Controls'
import { Icon } from '../../components/Icon'
import { ModalHeader, SheetPage } from '../../components/Overlay'
@@ -13,8 +13,6 @@ import { errorText, market, type AgentAuth, type AuthMethod } from './market-mod
import { ErrorText, Field, ScreenHeader, SlideStack, WebLink, filled } from './pieces'
import { AgentBrings } from './AgentBrings'
import { SetupTerminalView } from './SetupTerminal'
-import { CustomIconEditor } from '../bots/CustomIconEditor'
-import { CustomIcon, useAgentIcon } from '../../components/CustomIcon'
type SetupRoute = { kind: 'install' } | { kind: 'node' } | { kind: 'terminal'; method: AuthMethod | null } | { kind: 'keys'; method: AuthMethod }
@@ -39,29 +37,11 @@ export function agentTint(registry: string | null | undefined) {
export function AgentTile({ registry, icon, tile, radius }: { registry?: string | null; icon: number; tile: number; radius: number }) {
return (
<div className="agent-tile" style={{ width: tile, height: tile, borderRadius: radius }}>
- <TintedAgentIcon registry={registry} size={icon} />
+ <AgentIcon registry={registry} size={icon} color={agentTint(registry)} />
</div>
)
}
-/** `AgentIcon` painted with `agentTint` (which can be a gradient, so a mask over `background`). */
-function TintedAgentIcon({ registry, size }: { registry?: string | null; size: number }) {
- const custom = useAgentIcon(registry)
- return <CustomIcon icon={custom} size={size} color={agentTint(registry)} fallback={<BundledAgentIcon registry={registry} size={size} />} />
-}
-
-function BundledAgentIcon({ registry, size }: { registry?: string | null; size: number }) {
- const url = agentIconURL(registry)
- if (!url) return <Icon name="terminal" size={size * 0.8} scaled={false} />
- return (
- <span
- aria-hidden
- className="agent-icon"
- style={{ width: size, height: size, background: agentTint(registry), WebkitMaskImage: `url("${url}")` }}
- />
- )
-}
-
/**
* Above the agents while some of them run on Node.js and the computer has none: one place to
* add Codync's copy for all of them.
@@ -213,7 +193,6 @@ export function AgentSheet({ initial, recheck = false }: { initial: Backend; rec
subtitle={backend.description || undefined}
/>
<CardForm>
- <CardSection><CustomIconEditor target={`agent:${backend.id}`} /></CardSection>
{curated ? (
<CardSection>
<SetupStepRow
diff --git a/apps/desktop/src/renderer/views/marketplace/marketplace.css b/apps/desktop/src/renderer/views/marketplace/marketplace.css
index a41ccb83..4b170a79 100644
--- a/apps/desktop/src/renderer/views/marketplace/marketplace.css
+++ b/apps/desktop/src/renderer/views/marketplace/marketplace.css
@@ -141,14 +141,6 @@
background: var(--bubble-agent);
color: var(--text);
}
-/* The logo as a mask over its tint (agentTint can be a gradient). */
-.agent-icon {
- display: inline-block;
- flex: none;
- -webkit-mask-size: contain;
- -webkit-mask-repeat: no-repeat;
- -webkit-mask-position: center;
-}
.market-row {
display: flex;
diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentIcon.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentIcon.swift
index 9aea77aa..6e16a509 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentIcon.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentIcon.swift
@@ -5,7 +5,6 @@ import UIKit
/// A coding agent's logo, by ACP registry id or by Codync's id for agents outside the registry,
/// tinted like text; a terminal glyph otherwise.
public struct AgentIcon: View {
- @Environment(BotStore.self) private var store
let registry: String?
let size: CGFloat
@@ -16,9 +15,7 @@ public struct AgentIcon: View {
public var body: some View {
Group {
- if let custom = customIcon, custom.image != nil {
- CustomIconView(icon: custom, size: size)
- } else if let name = registry.map({ "agent-\($0)" }), Self.exists(name) {
+ if let name = registry.map({ "agent-\($0)" }), Self.exists(name) {
Image(name, bundle: .module).resizable().scaledToFit()
} else {
Image(systemName: "terminal").resizable().scaledToFit().padding(size * 0.1)
@@ -28,12 +25,6 @@ public struct AgentIcon: View {
.foregroundStyle(tint)
}
- private var customIcon: CustomIcon? {
- guard let registry else { return nil }
- let backend = store.hello?.backends.first { $0.id == registry || $0.registry == registry }
- return store.icons["agent:\(backend?.id ?? registry)"]
- }
-
/// Registry logos are one-color; paint the ones with a known brand color in it.
private var tint: AnyShapeStyle {
switch registry {
diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentSheet.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentSheet.swift
index 7351a056..22393638 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentSheet.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentSheet.swift
@@ -102,7 +102,6 @@ struct AgentSheet: View {
private var overview: some View {
CardForm {
CardSection {
- CustomIconEditor(target: "agent:\(backend.id)")
HStack(spacing: 14) {
AgentIcon(registry: backend.registry ?? backend.id, size: 30)
.frame(width: 52, height: 52)
diff --git a/cloud/test/e2e/relay.e2e.ts b/cloud/test/e2e/relay.e2e.ts
index da91b02b..d68019d9 100644
--- a/cloud/test/e2e/relay.e2e.ts
+++ b/cloud/test/e2e/relay.e2e.ts
@@ -181,10 +181,12 @@ async function main() {
const signed = await loopback("claimSign", { claimId: claim.body.claimId, nonce: claim.body.nonce, userId });
check((await cloud("POST", `/v1/claims/${claim.body.claimId}/complete`, { token, body: signed })).status === 200, "icon test computer claimed");
await waitFor("icon host sees its owner", async () => (await loopback("cloudStatus")).owner?.userId === userId || undefined);
- const png = await exerciseIcons((method, body) => ch.call(method, body, 60_000), "agent:claude");
+ const target = `bot:${(await ch.call("createBot", { name: "Icons", backend: "custom", command: "true", cwd: tmp })).bot.id}`;
+ const png = await exerciseIcons((method, body) => ch.call(method, body, 60_000), target);
+ check(await ch.call("setIcon", { target: "agent:claude", remove: true }).then(() => false, () => true), "agents have no custom icons");
await stop(host!);
await startHost();
- check((await loopback("hello")).icons["agent:claude"].dataUrl === png, "icon remains cached after host restart");
+ check((await loopback("hello")).icons[target].dataUrl === png, "icon remains cached after host restart");
return;
}
diff --git a/docs/features/custom-icons.md b/docs/features/custom-icons.md
index 8660272a..e513c4c6 100644
--- a/docs/features/custom-icons.md
+++ b/docs/features/custom-icons.md
@@ -1,14 +1,20 @@
-# Custom agent and bot icons
+# Custom bot icons
Issue: [#114](https://github.com/leepokai/Codync/issues/114).
The host owns image import and persistence (`host/src/icons/`). Clients send `setIcon`
-with `target: "agent:<backend-id>"` or `"bot:<bot-id>"` and either standard-base64
+with `target: "bot:<bot-id>"` and either standard-base64
`data`, an HTTPS `url`, a `tinted` flag, or `remove: true`. Changes save immediately;
they are separate from a bot's draft settings. Authorized control devices may use it;
pairing-only and screen-only devices may not. The terminal reads its local file before
calling the API; remote clients cannot make the host read a local path.
+Agents keep their bundled logos: the host rejects any other target, and the cleanup loop
+removes icons that 2.33.2–2.33.6 saved for agents. Their R2 slot is deleted when the cloud
+allows it; the local entry goes either way (the slot is overwritten when reused). Clients from
+2.33.2–2.33.6 still show an agent Custom icon card, whose changes fail with "Only bots have
+custom icons"; that is accepted without raising `MIN_APP`, since nothing else breaks.
+
## Limits and validation
- PNG, JPEG, WebP: 5 MiB input, at most 4096 pixels on either axis, bounded decoder allocation.
@@ -37,8 +43,8 @@ and reconnect use the persistent host cache and do not make R2 GET requests.
Snapshots carry a monotonic revision; clients ignore delayed older replies/events before updating their local caches.
An R2 write must succeed before replacing the local icon. Failed imports keep the previous
-cache; color-only changes need no R2 write. Removal deletes R2 first. Deleted bots' slots
-are swept in small batches, retrying failed cleanup each minute. Account deletion revokes device access and blocks
+cache; color-only changes need no R2 write. Removal deletes R2 first. Slots whose target is no longer
+a live bot are swept in small batches, retrying failed cleanup each minute. Account deletion revokes device access and blocks
new writes before removing encrypted images, then finishes unclaiming computers; an R2 error
leaves ownership available for webhook retry. Unclaiming alone retains the encrypted cache
for the same computer identity; it cannot read/write R2 while unclaimed.
diff --git a/docs/features/marketplace.md b/docs/features/marketplace.md
index 97324dc4..0043615f 100644
--- a/docs/features/marketplace.md
+++ b/docs/features/marketplace.md
@@ -139,4 +139,4 @@ immediately; setup failures remain visible for retry.
## Custom icons
-Agents and bots support per-computer image overrides. See [custom icons](custom-icons.md) for the API, storage limits, cache behavior and deployment.
+Agents show their bundled logo (a terminal symbol when none is bundled); only bots take custom images. See [custom icons](custom-icons.md) for the API, storage limits, cache behavior and deployment.
diff --git a/host/src/icons/cleanup.rs b/host/src/icons/cleanup.rs
index 29467bc0..0a40b2cc 100644
--- a/host/src/icons/cleanup.rs
+++ b/host/src/icons/cleanup.rs
@@ -1,7 +1,9 @@
//! Retry cleanup after bot deletion, including when the cloud was unavailable at deletion time.
-use super::{commit, list, storage};
-use crate::hub::Hub;
+//! Any icon whose target isn't a live bot goes, including agent icons saved before agents lost them.
+use super::{Icon, commit, list, live_bot, storage};
+use crate::{hub::Hub, store::Store};
use anyhow::Result;
+use std::collections::BTreeMap;
use std::sync::Arc;
use std::time::Duration;
@@ -16,23 +18,33 @@ pub(crate) async fn run(hub: Arc<Hub>) {
}
}
-async fn sweep(hub: &Hub) -> Result<()> {
+pub(super) async fn sweep(hub: &Hub) -> Result<()> {
let Ok(_guard) = hub.store.icon_lock.try_lock() else { return Ok(()) };
let mut icons = list(&hub.store)?;
- let mut removed = 0;
- for (target, icon) in icons.clone() {
- let Some(id) = target.strip_prefix("bot:") else { continue };
- if hub.store.bot(id)?.is_some_and(|b| !b.deleted) {
- continue;
+ for target in stale(&hub.store, &icons)?.into_iter().take(8) {
+ let Some(icon) = icons.remove(&target) else { continue };
+ if let Err(error) = storage::delete(hub, icon.slot).await {
+ // A deleted bot's image stays until the cloud removes it. Agent icons leave the cache
+ // even when the cloud refuses (unclaimed, signed out, cloud off): their slot is
+ // overwritten when reused, and account deletion wipes every slot.
+ if target.starts_with("bot:") {
+ return Err(error);
+ }
+ tracing::warn!(icon = target, error = format!("{error:#}"), "agent icon left in cloud storage");
}
- storage::delete(hub, icon.slot).await?;
- icons.remove(&target);
// Commit each deletion so a later network failure resumes at the next slot.
icons = commit(hub, icons)?.icons;
- removed += 1;
- if removed == 8 {
- break;
- }
}
Ok(())
}
+
+/// Targets that aren't a live bot: deleted bots, and agents (which no longer take custom icons).
+pub(super) fn stale(store: &Store, icons: &BTreeMap<String, Icon>) -> Result<Vec<String>> {
+ let mut stale = Vec::new();
+ for target in icons.keys() {
+ if !live_bot(store, target)? {
+ stale.push(target.clone());
+ }
+ }
+ Ok(stale)
+}
diff --git a/host/src/icons/mod.rs b/host/src/icons/mod.rs
index d0c05bb3..1cc9e3ac 100644
--- a/host/src/icons/mod.rs
+++ b/host/src/icons/mod.rs
@@ -1,4 +1,4 @@
-//! Custom agent/bot icons: host validation, local cache and private encrypted R2 storage.
+//! Custom bot icons: host validation, local cache and private encrypted R2 storage.
mod cleanup;
mod image;
pub(crate) use cleanup::run as cleanup_loop;
@@ -55,7 +55,7 @@ fn commit(hub: &Hub, icons: BTreeMap<String, Icon>) -> Result<Snapshot> {
pub(crate) async fn set(hub: &Arc<Hub>, b: &Value) -> Result<Value> {
let target = b["target"].as_str().context("Icon target is required")?;
- validate_target(hub, target)?;
+ validate_target(&hub.store, target)?;
// Bound concurrent decoding and serialize R2 replacements with local commits.
let _guard = hub.store.icon_lock.try_lock().context("Another icon is being saved; try again shortly")?;
let mut icons = list(&hub.store)?;
@@ -97,14 +97,15 @@ pub(crate) async fn set(hub: &Arc<Hub>, b: &Value) -> Result<Value> {
Ok(serde_json::to_value(commit(hub, icons)?)?)
}
-fn validate_target(hub: &Hub, target: &str) -> Result<()> {
+fn validate_target(store: &Store, target: &str) -> Result<()> {
ensure!(target.len() <= 256, "Invalid icon target");
- if let Some(id) = target.strip_prefix("bot:") {
- ensure!(hub.store.bot(id)?.is_some_and(|b| !b.deleted), "Unknown bot");
- } else if let Some(id) = target.strip_prefix("agent:") {
- ensure!(crate::agent::backends::list().iter().any(|b| b["id"] == id), "Unknown agent");
- } else {
- anyhow::bail!("Choose an agent or bot icon");
- }
+ ensure!(target.starts_with("bot:"), "Only bots have custom icons");
+ ensure!(live_bot(store, target)?, "Unknown bot");
Ok(())
}
+
+/// Whether `target` names an existing, undeleted bot: the only icons the host keeps.
+fn live_bot(store: &Store, target: &str) -> Result<bool> {
+ let Some(id) = target.strip_prefix("bot:") else { return Ok(false) };
+ Ok(store.bot(id)?.is_some_and(|b| !b.deleted))
+}
diff --git a/host/src/icons/tests.rs b/host/src/icons/tests.rs
index 5113ecfb..30abea25 100644
--- a/host/src/icons/tests.rs
+++ b/host/src/icons/tests.rs
@@ -5,6 +5,9 @@ fn hub() -> (Arc<Hub>, std::path::PathBuf) {
let dir = std::env::temp_dir().join(format!("codync-icons-{}", uuid::Uuid::new_v4()));
std::fs::create_dir_all(&dir).unwrap();
let store = Store::open(&dir.join("t.db")).unwrap();
+ store
+ .save_bot(&serde_json::from_value(json!({"id": "b1", "name": "b", "backend": "codex", "cwd": "/tmp"})).unwrap())
+ .unwrap();
let identity = Identity::load_or_create(&dir).unwrap();
(Hub::new(store, "test".into(), identity, "token".into(), 0), dir)
}
@@ -14,20 +17,20 @@ async fn cached_icons_and_color_changes_do_not_need_cloud_downloads() {
let (hub, dir) = hub();
let png = image::normalize(br##"<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><rect width="32" height="32" fill="#f00"/></svg>"##).unwrap();
let icon = Icon { slot: 0, data_url: format!("data:image/png;base64,{}", STANDARD.encode(png)), tinted: false };
- commit(&hub, BTreeMap::from([("agent:claude".to_owned(), icon)])).unwrap();
- let before = list(&hub.store).unwrap()["agent:claude"].data_url.clone();
+ commit(&hub, BTreeMap::from([("bot:b1".to_owned(), icon)])).unwrap();
+ let before = list(&hub.store).unwrap()["bot:b1"].data_url.clone();
let before_revision = snapshot(&hub.store).unwrap().icons_revision;
- let result = set(&hub, &json!({"target": "agent:claude", "tinted": true})).await.unwrap();
- assert_eq!(result["icons"]["agent:claude"]["dataUrl"], before);
- assert_eq!(result["icons"]["agent:claude"]["tinted"], true);
+ let result = set(&hub, &json!({"target": "bot:b1", "tinted": true})).await.unwrap();
+ assert_eq!(result["icons"]["bot:b1"]["dataUrl"], before);
+ assert_eq!(result["icons"]["bot:b1"]["tinted"], true);
assert!(result["iconsRevision"].as_i64().unwrap() > before_revision);
// The cache survives reopening SQLite; there is no HTTP request on either read path.
let reopened = Store::open(&dir.join("t.db")).unwrap();
- assert_eq!(list(&reopened).unwrap()["agent:claude"].data_url, before);
+ assert_eq!(list(&reopened).unwrap()["bot:b1"].data_url, before);
assert_eq!(snapshot(&reopened).unwrap().icons_revision, result["iconsRevision"].as_i64().unwrap());
- let error = set(&hub, &json!({"target": "agent:claude", "data": STANDARD.encode(b"bad image")})).await;
+ let error = set(&hub, &json!({"target": "bot:b1", "data": STANDARD.encode(b"bad image")})).await;
assert!(error.is_err());
- assert_eq!(list(&hub.store).unwrap()["agent:claude"].data_url, before);
+ assert_eq!(list(&hub.store).unwrap()["bot:b1"].data_url, before);
drop(reopened);
drop(hub);
std::fs::remove_dir_all(dir).unwrap();
@@ -37,10 +40,30 @@ async fn cached_icons_and_color_changes_do_not_need_cloud_downloads() {
async fn concurrent_changes_and_unknown_targets_are_rejected_before_uploading() {
let (hub, dir) = hub();
assert!(set(&hub, &json!({"target": "bot:missing", "data": ""})).await.is_err());
+ let agent = set(&hub, &json!({"target": "agent:claude", "remove": true})).await.unwrap_err();
+ assert!(agent.to_string().contains("Only bots"));
let guard = hub.store.icon_lock.lock().await;
- let error = set(&hub, &json!({"target": "agent:claude", "data": ""})).await.unwrap_err();
+ let error = set(&hub, &json!({"target": "bot:b1", "data": ""})).await.unwrap_err();
assert!(error.to_string().contains("Another icon"));
drop(guard);
drop(hub);
std::fs::remove_dir_all(dir).unwrap();
}
+
+#[tokio::test]
+async fn cleanup_clears_agent_and_deleted_bot_icons_but_keeps_live_bots() {
+ let (hub, dir) = hub();
+ let icon = |slot| Icon { slot, data_url: String::new(), tinted: false };
+ let icons = BTreeMap::from([
+ ("agent:claude".to_owned(), icon(0)),
+ ("bot:b1".to_owned(), icon(1)),
+ ("bot:gone".to_owned(), icon(2)),
+ ]);
+ assert_eq!(cleanup::stale(&hub.store, &icons).unwrap(), ["agent:claude", "bot:gone"]);
+ // Tests have no cloud: the agent icon still leaves, the deleted bot's waits for its R2 delete.
+ commit(&hub, icons).unwrap();
+ assert!(cleanup::sweep(&hub).await.is_err());
+ assert_eq!(list(&hub.store).unwrap().keys().collect::<Vec<_>>(), ["bot:b1", "bot:gone"]);
+ drop(hub);
+ std::fs::remove_dir_all(dir).unwrap();
+}
diff --git a/host/src/tui/manage/agent.rs b/host/src/tui/manage/agent.rs
index 1661b25c..37f89a4c 100644
--- a/host/src/tui/manage/agent.rs
+++ b/host/src/tui/manage/agent.rs
@@ -59,9 +59,6 @@ impl App {
}
rows.push(SetupRow::Check);
rows.push(SetupRow::Brings);
- if self.custom_icons {
- rows.push(SetupRow::Icon);
- }
rows
}
@@ -76,11 +73,6 @@ impl App {
let (cols, rows_n) = crossterm::terminal::size().unwrap_or((80, 24));
let size = json!({"cols": cols, "rows": rows_n});
match rows.get(a.cursor) {
- Some(SetupRow::Icon) => {
- self.overlays.push(Overlay::Agent(a));
- self.overlays.push(Overlay::Fields(Box::new(super::icon_fields(format!("agent:{backend}")))));
- return None;
- }
Some(SetupRow::Install) => self.start_setup(&backend, "install", None, &size),
Some(SetupRow::Node) => self.start_setup(&backend, "node", None, &size),
Some(SetupRow::Login) => self.start_setup(&backend, "login", None, &size),
diff --git a/host/src/tui/manage/mod.rs b/host/src/tui/manage/mod.rs
index 6adc904c..bac7ec8f 100644
--- a/host/src/tui/manage/mod.rs
+++ b/host/src/tui/manage/mod.rs
@@ -183,7 +183,6 @@ pub struct AgentSetup {
}
pub enum SetupRow {
- Icon,
Install,
Node,
Login,
diff --git a/host/src/tui/sheets.rs b/host/src/tui/sheets.rs
index 1929cbbe..91047c0a 100644
--- a/host/src/tui/sheets.rs
+++ b/host/src/tui/sheets.rs
@@ -322,7 +322,6 @@ pub fn agent(buf: &mut Buffer, area: Rect, app: &App, a: &AgentSetup) {
),
SetupRow::Check => ("↻", "Check again".to_owned(), String::new()),
SetupRow::Brings => ("≡", "What the agent brings".to_owned(), String::new()),
- SetupRow::Icon => ("◈", "Custom icon".to_owned(), "Choose a file or URL, tint, or use default".to_owned()),
};
let title = tr(&title);
let detail = tr(&detail);
diff --git a/web/content/docs/agents.mdx b/web/content/docs/agents.mdx
index 504af873..07cfaf8c 100644
--- a/web/content/docs/agents.mdx
+++ b/web/content/docs/agents.mdx
@@ -124,9 +124,3 @@ There's no separate default-agent setting. A new bot gets Claude Code when Claud
A bot can have fallback agents that carry on the same turn when its own agent is out of usage, rate limited, signed out or won't start. See [Agent fallbacks](/docs/agent-fallbacks).
-
-## Custom agent icons
-
-Open an agent in **Extensions** and use **Custom icon** to upload an image, or choose **Paste URL** to reveal the address field and submit an HTTPS image URL with the arrow button. Keep the original colors or turn on **Tint icon**. Choose **Use default** to restore its bundled logo, or the terminal symbol when no logo is bundled. Each computer keeps its own overrides, shared by its paired apps.
-
-The [custom icon limits and caching rules](/docs/bots#custom-icons) also apply to agents. In the terminal, open the agent's setup and choose **Custom icon**.