Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Name the window's swarm on the dial and pick between them from the glass

0xdiego256086c23095ef
diff --git a/cli/src/cable/cableHost.ts b/cli/src/cable/cableHost.ts
index 263249191..f516654f5 100644
--- a/cli/src/cable/cableHost.ts
+++ b/cli/src/cable/cableHost.ts
@@ -17,7 +17,7 @@ import { fetchRelease, loadImage, shouldOffer } from './fwPush.js'
import { routeVoiceTask, type RouterAgent, type RouterContinuity } from '../lib/voiceRouter.js'
import { env } from '../config/env.js'
-import type { CableAgent, CableHost, CableMachine, CableMachineSource, DialStatus, RouteDecision } from './cableSession.js'
+import type { AppSwarms, CableAgent, CableHost, CableMachine, CableMachineSource, CableSwarm, DialStatus, RouteDecision } from './cableSession.js'
import type { WindowRoute } from './windowRoute.js'
import { FleetError, type FleetMachine, type MachineFleet } from './machineFleet.js'
@@ -53,6 +53,8 @@ export interface CableHostWiring {
focused?: (machineId: string, agentId: string) => void
/** A notification was tapped: the window gives that agent a tile of its own. */
opened?: (machineId: string, agentId: string) => void
+ /** The dial picked a swarm: the window switches to it. */
+ swarmSelected?: (swarmId: string) => void
/** A finger on the dial's glass, in pieces, while it is down. */
scrolled?: (phase: 'down' | 'move' | 'up', dy: number, velocity: number) => void
/** The dial came, went, or started taking an update — see CableSession's onDialStatus. */
@@ -338,10 +340,42 @@ export class DaemonCableHost implements CableHost {
this.desk = [...agentIds]
}
+ /** The window's swarms, or null once it has gone — see setSwarms. */
+ private swarms: AppSwarms | null = null
+
+ /**
+ * The window described its swarms (or, with null, went away).
+ *
+ * Also what makes the desk STRICT: a window that is present and says its desk is empty means it —
+ * a fresh swarm has no panes — and the carousel walks nothing rather than everything. A window that
+ * is gone said nothing, and the old fallback applies.
+ */
+ setSwarms(swarms: AppSwarms | null): void {
+ this.swarms = swarms
+ }
+
+ listSwarms(): { selected: string; swarms: CableSwarm[] } {
+ const app = this.swarms
+ if (!app) return { selected: '', swarms: [] }
+ return {
+ selected: app.active,
+ swarms: app.swarms.map((s) => ({ id: s.id, name: s.name, agents: s.agentIds.length })),
+ }
+ }
+
+ selectSwarm(swarmId: string): void {
+ if (!swarmId || !this.swarms?.swarms.some((s) => s.id === swarmId)) {
+ this.wiring.log(`cable: ignored select for unknown swarm ${swarmId || '(empty)'}`)
+ return
+ }
+ this.wiring.log(`cable: swarm → ${swarmId}`)
+ this.wiring.swarmSelected?.(swarmId)
+ }
+
async listAgents(): Promise<CableAgent[]> {
const out = await this.listAgentsFlat()
- const ring = deskRing(out.map((a) => a.id), this.desk)
+ const ring = deskRing(out.map((a) => a.id), this.desk, this.swarms !== null)
// Walked agents first, then the ones the dial knows but does not walk to —
// the session sends the count of the first group, so the order is the split.
const listed = [...ring.order, ...ring.offRing]
diff --git a/cli/src/cable/cableSession.spec.ts b/cli/src/cable/cableSession.spec.ts
index 8f98f0a97..45e3ed35c 100644
--- a/cli/src/cable/cableSession.spec.ts
+++ b/cli/src/cable/cableSession.spec.ts
@@ -81,6 +81,8 @@ function makeHost(over: Partial<CableHost> = {}) {
listMachines: async () => ({ machines: [LOCAL_ROW], source: 'backend' as const }),
selectedMachine: () => 'mac-local',
selectMachine: async () => ({ ok: true as const }),
+ listSwarms: () => ({ selected: '', swarms: [] }),
+ selectSwarm: vi.fn(),
appName: () => 'harness',
voiceLang: () => 'en',
listAgents: async () => AGENTS,
@@ -124,8 +126,9 @@ describe('cable session', () => {
expect(port.types()).toEqual(
// Machines FIRST: the dial paints its machine name from this list, so an agent list that lands
- // ahead of it shows a nameless placeholder for a frame.
- ['welcome', 'machines.begin', 'machine', 'machines.end', 'agents.begin', 'agent', 'agent', 'agents.end'],
+ // ahead of it shows a nameless placeholder for a frame. Swarms next, for the same reason: the line
+ // naming the tab is drawn on the tile the agent list is about to build.
+ ['welcome', 'machines.begin', 'machine', 'machines.end', 'swarms', 'agents.begin', 'agent', 'agent', 'agents.end'],
)
const welcome = port.sent[0]
expect(welcome).toMatchObject({ t: 'welcome', app: 'harness', machine: { name: 'MacBook Pro' } })
@@ -176,12 +179,38 @@ describe('cable session', () => {
await vi.waitFor(() => expect(port.types()).toContain('agents.end'))
expect(port.types()).toEqual(
// Machines FIRST: the dial paints its machine name from this list, so an agent list that lands
- // ahead of it shows a nameless placeholder for a frame.
- ['welcome', 'machines.begin', 'machine', 'machines.end', 'agents.begin', 'agent', 'agent', 'agents.end'],
+ // ahead of it shows a nameless placeholder for a frame. Swarms next, for the same reason: the line
+ // naming the tab is drawn on the tile the agent list is about to build.
+ ['welcome', 'machines.begin', 'machine', 'machines.end', 'swarms', 'agents.begin', 'agent', 'agent', 'agents.end'],
)
await session.stop()
})
+ it('names the swarms once and again only when they change, and relays a pick', async () => {
+ let swarms = { selected: 's1', swarms: [{ id: 's1', name: 'Workshop', agents: 2 }, { id: 's2', name: 'Launch', agents: 0 }] }
+ const host = makeHost({ listSwarms: () => swarms })
+ const { session, port } = await connect(host)
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await vi.waitFor(() => expect(port.types()).toContain('agents.end'))
+ expect(port.sent.filter((m) => m.t === 'swarms')).toEqual([
+ { t: 'swarms', selected: 's1', items: [{ id: 's1', name: 'Workshop', agents: 2 }, { id: 's2', name: 'Launch', agents: 0 }] },
+ ])
+
+ // Ticks with nothing new say nothing new — the same rule as the wheel.
+ await settle()
+ expect(port.sent.filter((m) => m.t === 'swarms')).toHaveLength(1)
+
+ // The dial picks. The host is told and nothing is answered on the wire: the window's new desk is
+ // the answer, and it arrives as the next swarms/ring push.
+ port.say({ t: 'swarm.select', swarmId: 's2' })
+ await settle()
+ expect(host.selectSwarm).toHaveBeenCalledWith('s2')
+ swarms = { ...swarms, selected: 's2' }
+ await vi.waitFor(() => expect(port.sent.filter((m) => m.t === 'swarms')).toHaveLength(2))
+ expect(port.sent.filter((m) => m.t === 'swarms')[1]).toMatchObject({ selected: 's2' })
+ await session.stop()
+ })
+
it('delivers a turn through the host, not through the protocol', async () => {
const host = makeHost()
const { session, port } = await connect(host)
diff --git a/cli/src/cable/cableSession.ts b/cli/src/cable/cableSession.ts
index a678ee89f..4a4cd32ae 100644
--- a/cli/src/cable/cableSession.ts
+++ b/cli/src/cable/cableSession.ts
@@ -168,6 +168,24 @@ export interface CableMachine {
local: boolean
}
+/**
+ * One of the window's swarms — a named group of agents arranged on one grid. The window owns them
+ * entirely (they live in its state file and nowhere else); the daemon relays the list so the dial can
+ * name the one on screen and offer the others, and relays a pick straight back.
+ */
+export interface CableSwarm {
+ id: string
+ name: string
+ /** How many agents it holds — the dial draws the count, never the members. */
+ agents: number
+}
+
+/** The window's swarms as it last described them, or null while no window is connected. */
+export interface AppSwarms {
+ active: string
+ swarms: Array<{ id: string; name: string; agentIds: string[] }>
+}
+
/** Why the list is as short as it is. The dial renders this, instead of drawing an empty wheel. */
export type CableMachineSource = 'backend' | 'local' | 'signed-out'
@@ -198,6 +216,10 @@ export interface CableHost {
* so the dial needs no table for a set it does not own.
*/
selectMachine(machineId: string): Promise<{ ok: true } | { ok: false; code: string; message: string }>
+ /** The window's swarms and which is on screen. Empty with no window: the dial then draws no swarm line. */
+ listSwarms(): { selected: string; swarms: CableSwarm[] }
+ /** The dial picked a swarm. Relayed to the window, which switches and re-describes its desk. */
+ selectSwarm(swarmId: string): void
appName(): string
voiceLang(): string
listAgents(): Promise<CableAgent[]>
@@ -466,6 +488,9 @@ export class CableSession {
this.machinesAt = Date.now()
await this.syncMachines()
}
+ // Swarms BEFORE agents: a swarm switch is a new swarm line and a new ring, and the line naming
+ // the tab should not lag the tiles that belong to it.
+ await this.syncSwarms()
await this.syncAgents()
}
}
@@ -701,6 +726,15 @@ export class CableSession {
case 'machine.select':
await this.selectMachine(str('machineId') ?? '')
return
+ case 'swarms.list':
+ await this.syncSwarms(true)
+ return
+ case 'swarm.select':
+ // Not answered here: the window switches, its desk changes, and the new `swarms` and ring
+ // pushes are the answer — the same shape as `machine.select`, minus the refusal, because the
+ // window never refuses to show a tab it has.
+ this.host.selectSwarm(str('swarmId') ?? '')
+ return
case 'models.list': {
// The one round trip in this protocol: the dial cannot draw a picker until the catalog is in hand,
// so it waits on this — briefly, and off its own UI task.
@@ -1122,10 +1156,32 @@ export class CableSession {
/** Attach: tell the dial everything, whether or not any of it looks unchanged from here. */
async pushAgents(): Promise<void> {
await this.syncMachines(true)
+ await this.syncSwarms(true)
await this.syncAgents(true)
await this.pushRestores()
}
+ // ── swarms ────────────────────────────────────────────────────────────────────────────────────────
+
+ private lastSwarmsKey = ''
+
+ /** Push the window's swarms IF they differ from what the dial was last told. Same rule as the wheel:
+ * the diff is what keeps the link idle while nothing changes. */
+ async syncSwarms(force = false): Promise<void> {
+ return this.queued(() => this.syncSwarmsNow(force))
+ }
+
+ private async syncSwarmsNow(force: boolean): Promise<void> {
+ const { selected, swarms } = this.host.listSwarms()
+ const key = `${selected}|${swarms.map((s) => `${s.id}:${s.name}:${s.agents}`).join('|')}`
+ if (!force && key === this.lastSwarmsKey) return
+ this.lastSwarmsKey = key
+ this.host.log(`cable: swarms → ${swarms.length}${selected ? ` (on ${selected})` : ''}${force ? ' [push]' : ''}`)
+ // ONE frame, not a begin/row/end stream: two dozen rows of an id, a name and a count fit in a
+ // kilobyte, and the dial replaces the whole list on arrival either way.
+ await this.send({ t: 'swarms', selected, items: swarms.map((s) => ({ id: s.id, name: s.name, agents: s.agents })) })
+ }
+
// ── machines ──────────────────────────────────────────────────────────────────────────────────────
/** What the dial has been told about the wheel, as one comparable string. Order counts: it is render
diff --git a/cli/src/cable/deskRing.spec.ts b/cli/src/cable/deskRing.spec.ts
index 9b55ec124..7a2932d98 100644
--- a/cli/src/cable/deskRing.spec.ts
+++ b/cli/src/cable/deskRing.spec.ts
@@ -29,6 +29,14 @@ describe('deskRing', () => {
expect(ring.offRing).toEqual([])
})
+ it('walks NOTHING when a present window says its desk is empty', () => {
+ // A fresh swarm has no panes. The window is there and describing it, so an empty carousel is the
+ // truth — the agents stay counted and listed, they are simply not what was chosen to look at.
+ const ring = deskRing(FLAT, [], true)
+ expect(ring.order).toEqual([])
+ expect(ring.offRing).toEqual(FLAT)
+ })
+
it('ignores tiles this daemon has never heard of', () => {
// A tile can name an agent on a machine that has gone quiet. The ring is no place to learn that,
// and a walk that stepped onto an id nothing can be looked up by lands on a blank tile.
diff --git a/cli/src/cable/deskRing.ts b/cli/src/cable/deskRing.ts
index 981467a71..fb1877bed 100644
--- a/cli/src/cable/deskRing.ts
+++ b/cli/src/cable/deskRing.ts
@@ -30,7 +30,12 @@ export interface DeskRing {
* know are ignored: a tile can name an agent on a machine that has
* gone quiet, and a ring is no place to learn that.
*/
-export function deskRing(flat: string[], desk: string[]): DeskRing {
+/**
+ * @param strict the window is open and this desk is what it really shows, even when that is nothing.
+ * A swarm with no panes yet is an empty desk on purpose, and the carousel says so rather
+ * than walking every agent the window is deliberately not showing.
+ */
+export function deskRing(flat: string[], desk: string[], strict = false): DeskRing {
const known = new Set(flat)
const onDesk = desk.filter((id) => known.has(id))
@@ -40,7 +45,11 @@ export function deskRing(flat: string[], desk: string[]): DeskRing {
// from that desk would be empty: eight agents on the machine and a carousel showing none of them,
// which reads as a broken dial rather than as a closed window. So with nothing to narrow to, the
// walk is the whole list, exactly as it was before any of this existed.
- if (onDesk.length === 0) return { order: [...flat], offRing: [] }
+ //
+ // UNLESS the window said so. `strict` is the window being present and describing an empty desk —
+ // a fresh swarm — and there the honest carousel is an empty one: the agents are still counted and
+ // still listed, they are simply not what the person chose to look at.
+ if (onDesk.length === 0) return strict ? { order: [], offRing: [...flat] } : { order: [...flat], offRing: [] }
const deskSet = new Set(onDesk)
return { order: onDesk, offRing: flat.filter((id) => !deskSet.has(id)) }
diff --git a/cli/src/cli.ts b/cli/src/cli.ts
index 7c90fdc4f..37ad71cdb 100644
--- a/cli/src/cli.ts
+++ b/cli/src/cli.ts
@@ -2919,6 +2919,14 @@ async function runForeground(session: AuthSession): Promise<void> {
// An OPEN tile counts as seen, deliberately — not a focused one. With four
// tiles on a grid all four are on screen, and asking which one the eye is
// on is a question the window cannot answer honestly anyway.
+ // The window's swarms. Relayed to the dial as its own list — the dial names the one on screen above
+ // the agent and offers the rest — and, through setSwarms, what makes the desk strict: a present
+ // window with an empty swarm is an empty carousel, not the whole machine.
+ onAppSwarms: (swarms) => {
+ cableHostRef?.setSwarms(swarms)
+ void cableRef?.syncSwarms()
+ void cableRef?.syncAgents()
+ },
onAppPanes: (agentIds) => {
// ORDER matters here, not just membership. The dial's carousel is built
// around these — tiles first, in tile order — so the thumb walks the same
@@ -4215,6 +4223,8 @@ async function runForeground(session: AuthSession): Promise<void> {
// desk to replace; the carousel now only walks tiles that exist, so every focus is about one of them.
focused: (machineId, agentId) =>
backend.sendLocal({ type: 'dial_focus', payload: { machineId, agentId } }),
+ // The dial's swarm pick. Local-only like the two above: a tab is a thing THIS window has.
+ swarmSelected: (swarmId) => backend.sendLocal({ type: 'dial_swarm', payload: { swarmId } }),
scrolled: (phase, dy, velocity) => backend.sendLocal({ type: 'dial_scroll', payload: { phase, dy, velocity } }),
// Local-only like the three above: which desk has a dial on it is a fact about THIS computer.
dialStatus: (status) => backend.sendLocal({ type: 'dial_status', payload: status }),
diff --git a/cli/src/localWsServer.spec.ts b/cli/src/localWsServer.spec.ts
index c3bcd292b..27ac51932 100644
--- a/cli/src/localWsServer.spec.ts
+++ b/cli/src/localWsServer.spec.ts
@@ -136,6 +136,47 @@ describe('local CLI WebSocket', () => {
await vi.waitFor(() => expect(rosters).toEqual([['a1', 'a2'], []]))
})
+ it('takes the window\'s swarms, drops what is not a swarm, and forgets them on close', async () => {
+ const backend = new FakeBackend()
+ const seen: unknown[] = []
+ server = http.createServer((_req, res) => { res.statusCode = 404; res.end() })
+ local = attachLocalWsServer(server, {
+ machineId,
+ backend,
+ onAppSwarms: (swarms) => seen.push(swarms),
+ })
+ await new Promise<void>((resolve) => server!.listen(0, '127.0.0.1', resolve))
+ const url = `ws://127.0.0.1:${(server.address() as AddressInfo).port}/api/local-ws`
+
+ const ws = new WebSocket(url)
+ await onceOpen(ws)
+ const connected = onceMessage(ws)
+ ws.send(JSON.stringify({ type: 'machine_select', payload: { machineId, localProtocolVersion: 1 } }))
+ await connected
+
+ ws.send(JSON.stringify({ type: 'app_swarms', payload: {
+ active: 's2',
+ swarms: [
+ { id: 's1', name: 'Workshop', agentIds: ['a1', '', 7, 'a2'] },
+ { id: '', name: 'no id' },
+ 'junk',
+ { id: 's2', name: 'Launch' },
+ ],
+ } }))
+ await new Promise((resolve) => setTimeout(resolve, 20))
+ expect(seen).toEqual([{ active: 's2', swarms: [
+ { id: 's1', name: 'Workshop', agentIds: ['a1', 'a2'] },
+ { id: 's2', name: 'Launch', agentIds: [] },
+ ] }])
+ // Like app_panes: a fact about this desk, so the machine never sees it.
+ expect(backend.frames.map((frame) => frame.type)).toEqual([])
+
+ ws.close()
+ // The window is gone, and so are its tabs.
+ await vi.waitFor(() => expect(seen).toHaveLength(2))
+ expect(seen[1]).toBeNull()
+ })
+
it('follows an explicit app_focus, and keeps it off the wire', async () => {
const backend = new FakeBackend()
const moves: Array<{ machineId: string; agentId: string }> = []
diff --git a/cli/src/localWsServer.ts b/cli/src/localWsServer.ts
index 5cc3760b6..c66a93581 100644
--- a/cli/src/localWsServer.ts
+++ b/cli/src/localWsServer.ts
@@ -1,4 +1,5 @@
import { randomUUID } from 'node:crypto'
+import type { AppSwarms } from './cable/cableSession.js'
import type http from 'node:http'
import type { Socket } from 'node:net'
import { WebSocket, WebSocketServer, type RawData } from 'ws'
@@ -45,6 +46,12 @@ export interface LocalWsServerOptions {
onAppFocus?: (machineId: string, agentId: string) => void
/** Every agent the window currently has a tile for, across all its machines. */
onAppPanes?: (agentIds: string[]) => void
+ /**
+ * The window's swarms — its named groups of agents, one of them on screen. The whole list each time,
+ * and `null` when the window goes away, so the daemon never keeps describing tabs nobody can see.
+ * Consumed like app_panes: a fact about this desk, never forwarded to the machine.
+ */
+ onAppSwarms?: (swarms: AppSwarms | null) => void
/**
* The window asked WHICH AGENT a typed task belongs to (⌘K). Answers, and sends NOTHING.
*
@@ -150,6 +157,31 @@ function jsonFrame(raw: RawData): Frame | null {
}
}
+/**
+ * The window's swarm list, checked field by field. Anything that is not an id, a name and a list of
+ * agent ids is dropped rather than trusted — the same stance app_panes takes with its ids — and a
+ * payload with no usable swarm at all is treated as not sent.
+ */
+function appSwarmsFrom(payload: unknown): AppSwarms | null {
+ if (!payload || typeof payload !== 'object') return null
+ const p = payload as Record<string, unknown>
+ const rows = Array.isArray(p.swarms) ? p.swarms : []
+ const swarms: AppSwarms['swarms'] = []
+ for (const row of rows) {
+ if (!row || typeof row !== 'object') continue
+ const r = row as Record<string, unknown>
+ if (typeof r.id !== 'string' || !r.id || typeof r.name !== 'string') continue
+ const agentIds = Array.isArray(r.agentIds)
+ ? r.agentIds.filter((id): id is string => typeof id === 'string' && id !== '')
+ : []
+ swarms.push({ id: r.id, name: r.name.slice(0, 80), agentIds })
+ if (swarms.length === 24) break // the window's own ceiling
+ }
+ if (swarms.length === 0) return null
+ const active = typeof p.active === 'string' && swarms.some((s) => s.id === p.active) ? p.active : swarms[0].id
+ return { active, swarms }
+}
+
function binaryBytes(raw: RawData): Uint8Array {
if (Buffer.isBuffer(raw)) return new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength)
if (raw instanceof ArrayBuffer) return new Uint8Array(raw)
@@ -195,6 +227,7 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
let relay: RelaySession | null = null
/** Whether this connection ever reported a tile roster — only then is clearing it ours to do. */
let sentPanes = false
+ let sentSwarms = false
let alive = true
let chain = Promise.resolve()
@@ -293,6 +326,14 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
return
}
}
+ if (!isBinary && options.onAppSwarms) {
+ const frame = jsonFrame(raw)
+ if (frame?.type === 'app_swarms') {
+ const swarms = appSwarmsFrom(frame.payload)
+ if (swarms) { sentSwarms = true; options.onAppSwarms(swarms) }
+ return
+ }
+ }
// ⌘K: the only REQUEST/RESPONSE pair this socket serves. Everything else on it is one-way.
//
// It rides the app's OWN rpc convention — `payload.requestId` out, the same id back — which the
@@ -419,6 +460,7 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
// would keep silencing the dial for agents nobody can see any more —
// exactly backwards, and permanently.
if (sentPanes) options.onAppPanes?.([])
+ if (sentSwarms) options.onAppSwarms?.(null)
if (relay) { relay.detach(); relay = null }
else if (selected) void options.backend.unregisterLocalClient(connId)
selected = false
diff --git a/desktop/lib/state/app_state.dart b/desktop/lib/state/app_state.dart
index 0d35d99ca..996a1b6c8 100644
--- a/desktop/lib/state/app_state.dart
+++ b/desktop/lib/state/app_state.dart
@@ -1166,6 +1166,17 @@ class AppNotifier extends ChangeNotifier {
final pool = _pool;
if (pool == null) return;
final agentIds = <String>[for (final pane in panes) ?pane.agentId];
+ // The swarms travel with the tiles: the dial names the one on screen above the agent and offers
+ // the others, and a pick there comes back as `dial_swarm`. Names and member ids only — the layout
+ // inside a swarm is this window's business.
+ final swarmRows = [
+ for (final swarm in swarms)
+ {
+ 'id': swarm.id,
+ 'name': swarm.name,
+ 'agentIds': [for (final pane in swarm.panes) ?pane.agentId],
+ },
+ ];
for (final machineId in machineStates.keys) {
final connection = pool[machineId];
if (connection == null) continue;
@@ -1174,6 +1185,14 @@ class AppNotifier extends ChangeNotifier {
.sendTerminalFrame('app_panes', {'agentIds': agentIds})
.catchError((_) => false),
);
+ unawaited(
+ connection
+ .sendTerminalFrame('app_swarms', {
+ 'active': activeSwarmId,
+ 'swarms': swarmRows,
+ })
+ .catchError((_) => false),
+ );
}
}
@@ -4880,6 +4899,13 @@ class AppNotifier extends ChangeNotifier {
);
}
break;
+ case 'dial_swarm':
+ // The dial picked a swarm from its own list. The ordinary switch, exactly as ⌘] or a click on
+ // the tab: the desk changes, `_persistLayout` re-describes it, and the dial's ring and swarm
+ // line follow from that — nothing is answered to the dial directly.
+ final swarmId = payload['swarmId'];
+ if (swarmId is String && swarmId.isNotEmpty) selectSwarm(swarmId);
+ break;
case 'dial_open':
// A notification was tapped on the dial. Unlike `dial_focus` this asks for a tile of its own —
// see openAgentFromDial for why a finished turn is not a replacement for what is on screen.
diff --git a/desktop/test/dial_desk_test.dart b/desktop/test/dial_desk_test.dart
index 2ff239939..26e7b569b 100644
--- a/desktop/test/dial_desk_test.dart
+++ b/desktop/test/dial_desk_test.dart
@@ -182,6 +182,44 @@ void main() {
app.dispose();
});
+ test(
+ 'a dial_swarm frame switches the swarm, and an unknown id is ignored',
+ () async {
+ // The dial's swarm line. It sends the id it was given; the switch is the ordinary one, so the desk
+ // it re-describes is the other swarm's panes — which is what the dial's carousel then walks.
+ final app = await _withTiles(['a1', 'a2']);
+ final first = app.activeSwarmId;
+ app.newSwarm(name: 'Launch');
+ final second = app.activeSwarmId;
+ expect(second, isNot(first));
+
+ await app.handleEventForTest('m1', {
+ 'type': 'dial_swarm',
+ 'payload': {'swarmId': first},
+ });
+ expect(app.activeSwarmId, first);
+ expect(_desk(app), ['a1', 'a2']);
+
+ await app.handleEventForTest('m1', {
+ 'type': 'dial_swarm',
+ 'payload': {'swarmId': 'swarm-nope'},
+ });
+ expect(
+ app.activeSwarmId,
+ first,
+ reason: 'an id this window has no tab for changes nothing',
+ );
+
+ await app.handleEventForTest('m1', {
+ 'type': 'dial_swarm',
+ 'payload': {'swarmId': second},
+ });
+ expect(app.activeSwarmId, second);
+ expect(_desk(app), isEmpty, reason: 'the new swarm has no panes yet');
+ app.dispose();
+ },
+ );
+
test('an edge from an older daemon is ignored, not obeyed', () async {
// A daemon that predates this change still sends `edge` on its focus frames. The field is gone
// here, and the frame must land as an ordinary selection rather than replacing a tile at an end
diff --git a/device/esp32-circle/main/cable_client.c b/device/esp32-circle/main/cable_client.c
index 85255fa90..556491899 100644
--- a/device/esp32-circle/main/cable_client.c
+++ b/device/esp32-circle/main/cable_client.c
@@ -128,6 +128,21 @@ void cable_client_select_machine(const char *machine_id)
const char *cable_client_machine_id(void) { return s_machine_id; }
+void cable_client_select_swarm(const char *swarm_id)
+{
+ if (!swarm_id || !swarm_id[0]) return;
+ cJSON *root = msg("swarm.select");
+ if (!root) return;
+ cJSON_AddStringToObject(root, "swarmId", swarm_id);
+ send_json(root);
+}
+
+void cable_client_list_swarms(void)
+{
+ send_json(msg("swarms.list"));
+}
+
+
void cable_client_send_turn(const char *agent_id, const char *text)
{
if (!agent_id || !agent_id[0] || !text) return;
@@ -204,6 +219,7 @@ static model_item_t *s_models_out;
static int s_models_max;
static int s_models_n;
+
static void handle_models(const cJSON *p)
{
if (!s_models_sem || !s_models_out) return; // nobody is waiting; a late answer is not an error
@@ -368,6 +384,27 @@ static const char *str_of(const cJSON *o, const char *key)
return cJSON_IsString(v) && v->valuestring ? v->valuestring : NULL;
}
+// `swarms`: the whole list, replaced on arrival. Rows missing an id are dropped; a name is optional
+// (the window's default is "New swarm", but a blank one still has to be a row that can be picked).
+static void handle_swarms(const cJSON *p)
+{
+ static cable_swarm_t rows[SWARMS_MAX]; // static: 24 × ~76 B is too much for the reader task's stack
+ int n = 0;
+ const cJSON *it = NULL;
+ cJSON_ArrayForEach(it, cJSON_GetObjectItemCaseSensitive(p, "items")) {
+ if (n >= SWARMS_MAX) break;
+ const cJSON *id = cJSON_GetObjectItemCaseSensitive(it, "id");
+ if (!cJSON_IsString(id) || !id->valuestring[0]) continue;
+ snprintf(rows[n].id, sizeof(rows[n].id), "%s", id->valuestring);
+ const cJSON *name = cJSON_GetObjectItemCaseSensitive(it, "name");
+ snprintf(rows[n].name, sizeof(rows[n].name), "%s", cJSON_IsString(name) ? name->valuestring : "");
+ const cJSON *agents = cJSON_GetObjectItemCaseSensitive(it, "agents");
+ rows[n].agents = cJSON_IsNumber(agents) ? (int)agents->valuedouble : 0;
+ n++;
+ }
+ ui_swarms_replace(rows, n, str_of(p, "selected"));
+}
+
static void session_up(const cJSON *p)
{
const char *app = str_of(p, "app");
@@ -571,6 +608,7 @@ static void handle_message(const cJSON *root)
return;
}
if (strcmp(t, "models") == 0) { handle_models(p); return; }
+ if (strcmp(t, "swarms") == 0) { handle_swarms(p); return; }
if (strcmp(t, "agent.updated") == 0) {
// One agent changed. Cheapest correct answer is to re-ask: the daemon is on the other end of a
diff --git a/device/esp32-circle/main/cable_client.h b/device/esp32-circle/main/cable_client.h
index e68a0a551..61df8245a 100644
--- a/device/esp32-circle/main/cable_client.h
+++ b/device/esp32-circle/main/cable_client.h
@@ -128,6 +128,24 @@ void cable_client_select_machine(const char *machine_id);
// against, and what a select of the local row sends.
const char *cable_client_machine_id(void);
+// ── swarms ──────────────────────────────────────────────────────────────────────────────────────────
+// The window's swarms: named groups of agents, one of them on screen. The daemon relays the whole list
+// in one `swarms` frame whenever it changes, and relays a pick back to the window — which switches, and
+// re-describes its desk. The dial never answers a swarm frame; the next `swarms` + agent list IS the
+// answer. No window → an empty list, and the tile draws no swarm line.
+#define SWARM_ID_MAX 32
+#define SWARMS_MAX 24 // the window's own ceiling (AppNotifier.maxSwarms)
+typedef struct {
+ char id[SWARM_ID_MAX];
+ char name[NAME_MAX];
+ int agents; // how many agents it holds — drawn as a count, never as members
+} cable_swarm_t;
+
+// The user tapped a swarm. Not answered — see above.
+void cable_client_select_swarm(const char *swarm_id);
+// Re-ask for the list (a screen that just opened wants it fresh).
+void cable_client_list_swarms(void);
+
// Send what the user asked for, into `agent_id`. Fire-and-forget: everything after this arrives back as
// `turn.started` / `turn.done`, or as `turn.error` in words a person can act on.
void cable_client_send_turn(const char *agent_id, const char *text);
diff --git a/device/esp32-circle/main/ui/touch.c b/device/esp32-circle/main/ui/touch.c
index 90dfdb661..90967e177 100644
--- a/device/esp32-circle/main/ui/touch.c
+++ b/device/esp32-circle/main/ui/touch.c
@@ -305,18 +305,13 @@ static void touch_read(lv_indev_t *indev, lv_indev_data_t *data)
} else if (!pressed && nprev && ndrag) { // release of a captured gesture
int d = ndyl - ndy0;
if (ui_notif_is_open()) { if (d < -SWIPE_MIN_PX) ui_notif_swipe_up(); } // up → close (only if list at top)
- else if (d > SWIPE_MIN_PX) ui_switch_open(); // pull down from top → switcher
- // A TAP anywhere in the band opens the notifications.
- //
- // The bell is a button, but this band swallows every press that starts inside it — and the
- // bell sits INSIDE it, so only the few pixels below the band ever reached the button. It read
- // as a control that ignores you. The band is what the finger actually hits, so the band is
- // what answers.
- //
- // Only when the finger did not travel: the pull-down that opens the agent switcher starts in
- // this same band, and it is the gesture reached for far more often. `d` separates them, and a
- // tap is what is left when no swipe happened.
- else if (d > -SWIPE_MIN_PX && d < SWIPE_MIN_PX) ui_notif_open();
+ // Pull down from the top → the NOTIFICATIONS (owner, 2026-09-14). The gesture opened the
+ // agent switcher for a while; the switcher is retired from the glass now that the carousel
+ // walks the window's swarm and the swarm line above the name picks between swarms, so the
+ // pull-down goes back to the list it first opened. A TAP in the band opens the same list —
+ // the bell is a button, but this band swallows every press that starts inside it, and the
+ // bell sits INSIDE it.
+ else if (d > SWIPE_MIN_PX || (d > -SWIPE_MIN_PX && d < SWIPE_MIN_PX)) ui_notif_open();
ndrag = false; ncap = true;
}
nprev = pressed;
diff --git a/device/esp32-circle/main/ui/ui_screens.c b/device/esp32-circle/main/ui/ui_screens.c
index 35fe43b97..fc45350f3 100644
--- a/device/esp32-circle/main/ui/ui_screens.c
+++ b/device/esp32-circle/main/ui/ui_screens.c
@@ -234,6 +234,7 @@ static lv_obj_t *s_agent_acts;
// The three round marks on the bottom arc of an agent tile. Held individually because touch.c has to be
// able to ask whether a press landed on one — see ui_action_hit().
static lv_obj_t *s_agent_goal_btn, *s_agent_voice_btn, *s_agent_loop_btn;
+#define AGENT_TILE_GOAL_LOOP 0 // the Goal and Loop marks beside Voice on an agent tile — see build_agent_actions
static lv_obj_t *s_machines_tile; // Machines carousel tile (ring 1, between Settings and the agents)
static lv_obj_t *s_no_agents_tile; // persistent "No agents yet" page, shown at ring RING_LEAD ONLY when s_proj_count==0
static lv_obj_t *s_no_agents_hint_lbl; // the closing line under the command / the local create hint
@@ -478,6 +479,15 @@ static void switch_close(void); // close the picker without pic
// without swiping past everything in between.
#define SWITCH_LIST_MAX MAX_PROJECTS
static lv_obj_t *s_switch_screen; // full-screen overlay on the top layer, hidden by default
+// The window's swarms, as the daemon last relayed them, and the swarm picker that lists them. The list
+// arrives whole (`swarms`), so this is a straight copy; the selected id is what every tile's swarm line
+// draws. Count 0 = no window, and the line is hidden.
+static EXT_RAM_BSS_ATTR cable_swarm_t s_swarms[SWARMS_MAX];
+static int s_swarm_count;
+static char s_swarm_selected[SWARM_ID_MAX];
+static lv_obj_t *s_swarm_screen, *s_swarm_list; // the picker: same shape as the agent switcher
+static void swarm_picker_close(void);
+static void swarm_picker_rebuild(void);
static lv_obj_t *s_switch_list; // the scrollable column of rows inside it
// The ids currently drawn, indexed by the row's user_data. Fixed storage rather than a strdup per row:
// the array's life IS the picker's, and rows are rebuilt on every open. In PSRAM: at the full list size
@@ -514,7 +524,8 @@ typedef struct {
lv_obj_t *engine_text_lbl; // hidden compatibility fallback; known engines use product-mark images
lv_obj_t *model_lbl; // tappable Model chip above the name → opens the model picker (remote machines)
lv_obj_t *effort_lbl; // tappable Effort chip above the name → opens the effort picker (remote machines)
- lv_obj_t *ctl_row; // the [mark][Model][Effort] row itself — needed to ask whether it is on screen
+ lv_obj_t *ctl_row; // the swarm line above the name (was the [mark][Model][Effort] row) — asked whether it is on screen
+ lv_obj_t *swarm_lbl; // the swarm name inside it
lv_obj_t *body; // fills the space below the pinned name; centers its content (list/busy/todo)
lv_obj_t *list; // centered column of event rows
lv_obj_t *empty; // placeholder until first event
@@ -2895,8 +2906,8 @@ static bool agent_action_ready(void)
// (mockup/recap-done.html), the space is back, and a wheel that costs a tap to reach a button that was
// already on screen is a tax on the two actions people reach for least.
static void agent_voice_tap(lv_event_t *e) { (void)e; if (agent_action_ready()) voice_start_impl(VOICE_CMD_NONE); }
-static void agent_goal_tap (lv_event_t *e) { (void)e; if (agent_action_ready()) voice_start_impl(VOICE_CMD_GOAL); }
-static void agent_loop_tap (lv_event_t *e) { (void)e; if (agent_action_ready()) voice_start_impl(VOICE_CMD_LOOP); }
+static __attribute__((unused)) void agent_goal_tap (lv_event_t *e) { (void)e; if (agent_action_ready()) voice_start_impl(VOICE_CMD_GOAL); }
+static __attribute__((unused)) void agent_loop_tap (lv_event_t *e) { (void)e; if (agent_action_ready()) voice_start_impl(VOICE_CMD_LOOP); }
// Visible only on an AGENT tile — not the Overview (which has its own labelled row), not Settings or
// Machines, and not while a secondary screen is up.
@@ -2963,6 +2974,10 @@ static void build_agent_actions(void)
// …and pushed 20px further out: 99 → 79. The button is a CIRCLE, so what has to clear the bezel is its
// centre plus 40 — 172 + 40 = 212 against a 233 radius, 21px spare. Its bounding-box corner would not
// fit, which is why this is measured on the circle and not the box.
+ // GOAL AND LOOP ARE OFF THE TILE (owner, 2026-09-14): only Voice stays, in the same spot. Both are
+ // still reachable — a still hold on the tile is a Goal capture (touch.c) and the Overview keeps its
+ // labelled Goal / Loop buttons. Set AGENT_TILE_GOAL_LOOP to 1 to draw the two marks again.
+#if AGENT_TILE_GOAL_LOOP
{ lv_obj_t *b = agent_act_btn(79, 322, agent_goal_tap);
s_agent_goal_btn = b;
lv_obj_t *ring = lv_obj_create(b);
@@ -2983,6 +2998,7 @@ static void build_agent_actions(void)
lv_obj_set_style_border_width(c, k == 2 ? 0 : 4, 0);
lv_obj_set_style_border_color(c, COL_YELLOW, 0);
} }
+#endif
// Voice — the centre of the arc, 31px lower than its neighbours (the ±36° offset). It does NOT move
// sideways: it is the one under the resting thumb, and the other two spread away from it.
{ lv_obj_t *b = agent_act_btn(193, 353, agent_voice_tap);
@@ -2990,6 +3006,7 @@ static void build_agent_actions(void)
lv_obj_t *ic = lv_image_create(b);
lv_image_set_src(ic, &icon_act_voice); // 44px native, colour baked — see the note on the asset
lv_obj_center(ic); }
+#if AGENT_TILE_GOAL_LOOP
// Loop — the exported Figma repeat arrows, the same mark the Overview carries, and the mirror of Goal's
// 20px push: 287 → 307.
{ lv_obj_t *b = agent_act_btn(307, 322, agent_loop_tap);
@@ -2997,6 +3014,7 @@ static void build_agent_actions(void)
lv_obj_t *ic = lv_image_create(b);
lv_image_set_src(ic, &icon_act_loop); // 44px native, colour baked
lv_obj_center(ic); }
+#endif
}
static void overview_voice_tap(lv_event_t *e)
@@ -3701,12 +3719,17 @@ static void parse_and_store(proj_t *p)
// down with the rest of the tile, which bought some), and wider pills put "Sonnet"+"Medium" past that and
// clipped their corners on the bezel. The GAP is the cheap way to give the row air — it costs 2 gaps, not 6
// pill edges — so spend it there before touching the paddings again.
-#define CTL_CHIP_FONT (&lv_font_montserrat_22) // 18 → 22: 23 does not exist, and 24 leaves the row
- // ~10px off the round face's chord at this Y
-#define CTL_CHIP_PAD_H 11
-#define CTL_CHIP_PAD_V 5
+// 22 → 24 and the paddings +1 (owner, 2026-09-14: "tăng size lên 10%"). The chord objection to 24 was
+// about a ROW of three; the band holds one swarm pill now, which clears it with room to spare.
+#define CTL_CHIP_FONT (&lv_font_montserrat_24)
+#define CTL_CHIP_PAD_H 12
+#define CTL_CHIP_PAD_V 6
#define CTL_CHIP_GAP 13 // between pills (10 → 13: the row sits lower now, so there is room)
#define CTL_MARK_SRC 20 // every engine icon asset is 20x20
+#define SHELL_MARK 28 // the mark beside the name: 0.72 of a 38px name, rounded
+#define SHELL_MARK_GAP 10 // between the mark and the first letter
+static void swarm_line_tap(lv_event_t *e); // the swarm line → the swarm picker (defined with it)
+static void swarm_line_paint(proj_t *p); // name the selected swarm on this tile, or hide the line
// Chip row BOTTOM → agent name top.
//
// ⚠️ THIS AND TILE_PAD_TOP MOVE TOGETHER. The row FLOATS off the header, so its screen position is
@@ -3764,8 +3787,12 @@ static void header_ext_draw_cb(lv_event_t *e)
lv_event_set_ext_draw_size(e, ctl_band_h());
}
+// THE MODEL / EFFORT CHIPS ARE OFF THE TILE (owner, 2026-09-14): the band above the name is the swarm line
+// now. The chip, its tap handlers, the picker and the agent.update they send are kept unreferenced — the
+// picker is one build_shell call from being back.
+//
// A small glass-pill chip for the per-agent controls row (Model / Effort). Clickable → opens a picker.
-static lv_obj_t *ctl_chip(lv_obj_t *parent, lv_event_cb_t cb)
+static __attribute__((unused)) lv_obj_t *ctl_chip(lv_obj_t *parent, lv_event_cb_t cb)
{
lv_obj_t *c = lv_label_create(parent);
lv_obj_set_style_text_font(c, CTL_CHIP_FONT, 0);
@@ -3899,8 +3926,8 @@ static void request_picker(int want)
ui_show_picker_loading(want);
s_req_models = true;
}
-static void model_chip_tap(lv_event_t *e) { (void)e; request_picker(PICK_MODE_MODEL); }
-static void effort_chip_tap(lv_event_t *e) { (void)e; request_picker(PICK_MODE_EFFORT); }
+static __attribute__((unused)) void model_chip_tap(lv_event_t *e) { (void)e; request_picker(PICK_MODE_MODEL); }
+static __attribute__((unused)) void effort_chip_tap(lv_event_t *e) { (void)e; request_picker(PICK_MODE_EFFORT); }
@@ -4384,9 +4411,24 @@ static void create_tile(proj_t *p)
// rebuild correctly after free_content deletes the tile outside the active window.
// Engine badge = product mark. Claude is a recolored monochrome mask; other marks retain the exact
// colors from the same vendored assets used by the web app.
+// Size the name to its text, capped at what the mark leaves of the row. The header is a flex row
+// centred as a unit, so the mark sits one gap from the first letter whatever the name's length; a box
+// the width of the row would put the mark at the row's left edge and the name in the middle of what was
+// left, and the two would read as unrelated. LONG_DOT needs a real width to elide against, which is why
+// the text is measured rather than left to LV_SIZE_CONTENT.
+static void shell_name_fit(proj_t *p)
+{
+ if (!p->name_lbl) return;
+ bool mark = p->engine_lbl && !lv_obj_has_flag(p->engine_lbl, LV_OBJ_FLAG_HIDDEN);
+ int32_t cap = SAFE_CONTENT_W - (mark ? SHELL_MARK + SHELL_MARK_GAP : 0);
+ lv_point_t sz;
+ lv_text_get_size(&sz, lv_label_get_text(p->name_lbl), &geist_med_38, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
+ lv_obj_set_width(p->name_lbl, sz.x < cap ? sz.x : cap);
+}
+
static void apply_engine_label(proj_t *p)
{
- if (!p->engine_lbl || !p->engine_text_lbl) return;
+ if (!p->engine_lbl || !p->name_lbl) return;
const lv_image_dsc_t *src = NULL;
bool recolor = false;
if (!strcmp(p->engine, "claude")) { src = &icon_claude; recolor = true; }
@@ -4403,17 +4445,15 @@ static void apply_engine_label(proj_t *p)
else if (!strcmp(p->engine, "grok")) { src = &icon_grok; }
else if (!strcmp(p->engine, "agy")) { src = &icon_agy; }
else if (!strcmp(p->engine, "copilot")) { src = &icon_copilot; }
- lv_obj_add_flag(p->engine_text_lbl, LV_OBJ_FLAG_HIDDEN); // product-mark path only
+ if (p->engine_text_lbl) lv_obj_add_flag(p->engine_text_lbl, LV_OBJ_FLAG_HIDDEN); // product-mark path only
if (src) {
lv_image_set_src(p->engine_lbl, src);
- // Box = exactly one pill, artwork CENTRED inside it. Sizing the box to the zoomed bitmap instead
- // left it a pixel or two off the pills (integer rounding in the scale), and the row's flex centring
- // then split that difference — the mark read as sitting high next to the boxes. Pinning the box to
- // the pill height makes the row one band by construction, whatever the font or padding become.
+ // Box = the mark's own square, artwork CENTRED inside it. It sits beside the name now, at
+ // SHELL_MARK px — 0.72 of the name's size, the ratio the launch-page prototype draws the pair at.
lv_image_set_inner_align(p->engine_lbl, LV_IMAGE_ALIGN_CENTER);
lv_image_set_pivot(p->engine_lbl, (int32_t)src->header.w / 2, (int32_t)src->header.h / 2);
- lv_image_set_scale(p->engine_lbl, (uint32_t)ctl_mark_scale());
- lv_obj_set_size(p->engine_lbl, ctl_pill_h(), ctl_pill_h());
+ lv_image_set_scale(p->engine_lbl, (uint32_t)(SHELL_MARK * 256 / CTL_MARK_SRC));
+ lv_obj_set_size(p->engine_lbl, SHELL_MARK, SHELL_MARK);
lv_obj_set_style_image_recolor(p->engine_lbl, COL_CLAUDE, 0);
// Reset this on every engine change: the same LVGL image object may previously have shown Claude.
lv_obj_set_style_image_recolor_opa(p->engine_lbl, recolor ? LV_OPA_COVER : LV_OPA_TRANSP, 0);
@@ -4421,6 +4461,7 @@ static void apply_engine_label(proj_t *p)
} else {
lv_obj_add_flag(p->engine_lbl, LV_OBJ_FLAG_HIDDEN);
}
+ shell_name_fit(p);
}
// THE MACHINE LINE IS GONE from the agent tile (mockup/recap-done.html): the same fact is already on the
@@ -4438,69 +4479,68 @@ static void build_shell(proj_t *p)
if (!p->tile || p->header) return; // no tile, or shell already built
p->dot = NULL; // recap design drops the status dot (its only reader is guarded)
- // Keep name + engine as ONE top-level tile child. The engine line consumes space from the old 24px
- // name→body gap, so adding it does not push the recap card down or affect the round-screen margins.
+ // The header is ONE ROW: [engine mark] [name], centred as a pair (owner, 2026-09-14). The mark used to
+ // lead the chip row floating above the name; that row is the swarm line now (below), and the mark
+ // moved down beside the word it identifies, at 0.72 of the name's size and one gap from its first
+ // letter — see shell_name_fit for why the name is measured rather than boxed.
p->header = lv_obj_create(p->tile);
lv_obj_remove_style_all(p->header);
lv_obj_clear_flag(p->header, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE);
- // One line, always: the name. See the note above the header height.
lv_obj_set_size(p->header, SAFE_CONTENT_W, lv_font_get_line_height(&geist_med_38));
- lv_obj_set_flex_flow(p->header, LV_FLEX_FLOW_COLUMN);
- lv_obj_set_flex_align(p->header, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
-
+ lv_obj_set_flex_flow(p->header, LV_FLEX_FLOW_ROW);
+ lv_obj_set_flex_align(p->header, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
+ lv_obj_set_style_pad_column(p->header, SHELL_MARK_GAP, 0);
+ p->engine_lbl = lv_image_create(p->header); // engine product mark, sized by apply_engine_label
+ p->engine_text_lbl = NULL; // the text fallback went with the chip row
p->name_lbl = lv_label_create(p->header);
lv_obj_set_style_text_color(p->name_lbl, COL_FG, 0);
lv_obj_set_style_text_font(p->name_lbl, &geist_med_38, 0); // agent name — Medium for emphasis
- lv_obj_set_size(p->name_lbl, SAFE_CONTENT_W, lv_font_get_line_height(&geist_med_38));
lv_obj_set_style_text_align(p->name_lbl, LV_TEXT_ALIGN_CENTER, 0);
lv_label_set_long_mode(p->name_lbl, LV_LABEL_LONG_DOT);
lv_label_set_text(p->name_lbl, p->name[0] ? p->name : "\xE2\x80\xA6"); // model name, or "…" placeholder
-
- // Per-agent controls row FLOATING in the band ABOVE the name: [Engine] [Model] [Effort] pills, one style.
- // Remote machines only; a tap opens the model/effort picker. The notif pull-down zone was narrowed to
- // y<44 (touch.c) so taps here still reach LVGL.
+ // THE SWARM LINE, floating in the band above the name where the [mark][Model][Effort] chips were
+ // (owner, 2026-09-14: "bỏ luôn line chip, thay = line swarms"). It names the swarm the window has
+ // on screen — the tab whose panes this carousel walks — and a tap opens the list of the others.
+ // Hidden when the daemon has sent no swarms: no window, no tabs, nothing to name.
//
- // Parented to the HEADER, not the tile, so it tracks the name. A FLOATING child is positioned at
- // parent->coords.y1 + parent's top pad + offset, so hanging it off the tile pinned it to the tile's
- // pad_top — which the working state sets to 0, throwing the row ~48px off the top of the screen. The
- // header has no padding and flex moves it in both states, so anchoring here lands the row exactly one
- // CTL_NAME_GAP above the name whatever the state. Idle is unchanged: the row still sits at
- // TILE_PAD_TOP - (pill + gap). Only IN-parent aligns survive a re-layout (lv_obj_pos.c falls through
- // to `default:` for every LV_ALIGN_OUT_*), so this must stay TOP_MID with a negative offset.
+ // Parented to the HEADER, not the tile, for the reason the chip row was: a FLOATING child is placed
+ // from its parent's top pad, and the tile's changes between the idle and working layouts. Only
+ // IN-parent aligns survive a re-layout, so this stays TOP_MID with a negative offset.
lv_obj_add_flag(p->header, LV_OBJ_FLAG_OVERFLOW_VISIBLE); // the row hangs above the header's box
lv_obj_add_event_cb(p->header, header_ext_draw_cb, LV_EVENT_REFR_EXT_DRAW_SIZE, NULL); // …and stays tappable
- lv_obj_t *ctl = lv_obj_create(p->header);
+ // The same glass pill the Model chip wore (ctl_chip): dark fill, hairline border, full radius — the
+ // owner asked for the line to read as that button, not as bare text.
+ lv_obj_t *ctl = lv_button_create(p->header);
lv_obj_remove_style_all(ctl);
- lv_obj_set_size(ctl, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
+ lv_obj_set_size(ctl, LV_SIZE_CONTENT, ctl_pill_h());
+ lv_obj_set_style_pad_hor(ctl, CTL_CHIP_PAD_H, 0);
+ lv_obj_set_style_radius(ctl, LV_RADIUS_CIRCLE, 0);
+ lv_obj_set_style_bg_color(ctl, lv_color_hex(0x1c1e24), 0);
+ lv_obj_set_style_bg_opa(ctl, LV_OPA_70, 0);
+ lv_obj_set_style_bg_opa(ctl, LV_OPA_COVER, LV_STATE_PRESSED);
+ lv_obj_set_style_border_width(ctl, 1, 0);
+ lv_obj_set_style_border_color(ctl, lv_color_hex(0x3a3f4b), 0);
+ lv_obj_set_ext_click_area(ctl, 12); // forgiving tap target, as the chip had
lv_obj_set_flex_flow(ctl, LV_FLEX_FLOW_ROW);
lv_obj_set_flex_align(ctl, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
- lv_obj_set_style_pad_column(ctl, CTL_CHIP_GAP, 0);
- lv_obj_clear_flag(ctl, LV_OBJ_FLAG_SCROLLABLE);
+ lv_obj_set_style_pad_column(ctl, 8, 0);
+ lv_obj_clear_flag(ctl, LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_GESTURE_BUBBLE);
lv_obj_add_flag(ctl, LV_OBJ_FLAG_FLOATING);
lv_obj_align(ctl, LV_ALIGN_TOP_MID, 0, ctl_row_y());
- p->engine_lbl = lv_image_create(ctl); // engine product mark
- p->engine_text_lbl = lv_label_create(ctl); // retained as a hidden compatibility fallback
- lv_obj_set_size(p->engine_text_lbl, ctl_pill_h(), ctl_pill_h()); // fallback badge matches the pills too
- lv_obj_set_style_text_font(p->engine_text_lbl, CTL_CHIP_FONT, 0);
- lv_obj_set_style_text_align(p->engine_text_lbl, LV_TEXT_ALIGN_CENTER, 0);
- p->model_lbl = ctl_chip(ctl, model_chip_tap); // Model → opens the model picker
- // EFFORT IS OFF THE TILE (mockup/recap-done.html): it is a thing you set BEFORE a turn runs, and this
- // screen is what you read AFTER one finished. Everything behind it — the wheel, the picker mode, the
- // agent_update it sends — is untouched and one flip of this switch away.
- p->effort_lbl = AGENT_EFFORT_CHIP ? ctl_chip(ctl, effort_chip_tap) : NULL;
- apply_engine_label(p);
- model_chip_paint(p);
- effort_chip_paint(p);
+ lv_obj_add_event_cb(ctl, swarm_line_tap, LV_EVENT_CLICKED, NULL);
+ p->swarm_lbl = lv_label_create(ctl);
+ lv_obj_set_style_text_font(p->swarm_lbl, CTL_CHIP_FONT, 0); // the chip's own face and colour
+ lv_obj_set_style_text_color(p->swarm_lbl, COL_FG, 0);
+ lv_obj_set_style_max_width(p->swarm_lbl, 260, 0);
+ lv_label_set_long_mode(p->swarm_lbl, LV_LABEL_LONG_DOT);
+ // No ▾ after the name: the pill IS the affordance, as the Model chip was.
+ p->model_lbl = NULL; // the Model / Effort chips are gone from the tile; their painters accept NULL
+ p->effort_lbl = NULL;
p->ctl_row = ctl;
- // The machine on the cable carries a runtime model and effort, so the row applies.
- //
- // TAPPABLE, unlike the first cable machine this firmware served. Back then the picker's catalog came
- // from a backend RPC the cable had no socket for, so an open picker could never populate and the
- // chips were deliberately inert. The daemon answers `models.list` over the wire now, so the screen
- // fills — and a chip you cannot tap is a control that lies about being one.
- if (!AGENT_CTL_CHIPS) lv_obj_add_flag(ctl, LV_OBJ_FLAG_HIDDEN);
+ apply_engine_label(p);
+ swarm_line_paint(p);
}
@@ -4558,7 +4598,7 @@ static void free_content(int i)
p->busy = p->busy_verb = p->busy_meta = p->busy_icon = NULL;
p->tool_line = p->agents = p->todo = p->todo_active = NULL;
p->dot = p->header = p->name_lbl = p->engine_lbl = p->engine_text_lbl = p->model_lbl = p->effort_lbl = NULL;
- p->ctl_row = NULL;
+ p->ctl_row = NULL; p->swarm_lbl = NULL;
p->content_live = false;
}
@@ -5000,7 +5040,7 @@ void ui_project_set_name(const char *project_id, const char *name)
char clipped[80];
name_clip(filtered, clipped, sizeof(clipped));
snprintf(s_proj[i].name, sizeof s_proj[i].name, "%s", clipped); // MODEL: source of truth
- if (s_proj[i].name_lbl) lv_label_set_text(s_proj[i].name_lbl, clipped); // VIEW mirrors model (may be NULL when off-window)
+ if (s_proj[i].name_lbl) { lv_label_set_text(s_proj[i].name_lbl, clipped); shell_name_fit(&s_proj[i]); } // VIEW mirrors model (may be NULL when off-window)
}
display_unlock();
}
@@ -5253,6 +5293,7 @@ void ui_home_overview(void)
if (s_bright_dragging) return; // a brightness-slider drag on Settings is not a home swipe (mirror ui_swipe_*)
ui_notif_close(); // no-op if closed; takes/releases the lock itself (must not nest inside our lock)
display_lock();
+ swarm_picker_close();
if (tileview) {
if (lv_screen_active() != scr_projects) lv_screen_load(scr_projects);
carousel_goto(col_for_ring_near(carousel_col(), 0 /* overview ring */), LV_ANIM_OFF);
@@ -5503,7 +5544,10 @@ static void notif_rebuild(void)
bool ui_switch_is_open(void)
{
- return s_switch_screen && !lv_obj_has_flag(s_switch_screen, LV_OBJ_FLAG_HIDDEN);
+ // Either picker over the face. touch.c asks this to keep the pull-down band and the tap-to-open from
+ // acting under an open list, and the swarm picker wants exactly that treatment.
+ return (s_switch_screen && !lv_obj_has_flag(s_switch_screen, LV_OBJ_FLAG_HIDDEN))
+ || (s_swarm_screen && !lv_obj_has_flag(s_swarm_screen, LV_OBJ_FLAG_HIDDEN));
}
static void switch_close(void)
@@ -5660,6 +5704,158 @@ void ui_switch_open(void)
}
+// ---- Swarms ----------------------------------------------------------------------------------------
+//
+// A swarm is one of the window's tabs: a named group of agents on one grid. The carousel already walks
+// whatever the window has on screen (the daemon's ring is the active swarm's panes), so what the dial
+// adds is the NAME of that tab above the agent and a way to pick another. A pick goes to the daemon,
+// the daemon to the window, the window switches — and the new `swarms` and ring pushes are what change
+// the screen here. Nothing is written optimistically: the line names what the window shows, not what
+// was asked for, the same rule the machine wheel's ✓ follows.
+
+static void swarm_line_paint(proj_t *p)
+{
+ if (!p || !p->ctl_row || !p->swarm_lbl) return;
+ const cable_swarm_t *sel = NULL;
+ for (int i = 0; i < s_swarm_count; i++) if (strcmp(s_swarms[i].id, s_swarm_selected) == 0) { sel = &s_swarms[i]; break; }
+ if (!sel) { lv_obj_add_flag(p->ctl_row, LV_OBJ_FLAG_HIDDEN); return; }
+ lv_label_set_text(p->swarm_lbl, sel->name[0] ? sel->name : "New swarm");
+ lv_obj_clear_flag(p->ctl_row, LV_OBJ_FLAG_HIDDEN);
+}
+
+// Every live tile: the line is per-tile LVGL, the fact is global.
+static void swarm_lines_repaint(void)
+{
+ for (int i = 0; i < s_proj_count; i++) if (s_proj[i].content_live) swarm_line_paint(&s_proj[i]);
+}
+
+void ui_swarms_replace(const cable_swarm_t *rows, int count, const char *selected)
+{
+ display_lock();
+ if (count < 0) count = 0;
+ if (count > SWARMS_MAX) count = SWARMS_MAX;
+ if (count) memcpy(s_swarms, rows, (size_t)count * sizeof(*rows));
+ s_swarm_count = count;
+ snprintf(s_swarm_selected, sizeof(s_swarm_selected), "%s", selected ? selected : "");
+ swarm_lines_repaint();
+ if (s_swarm_screen && !lv_obj_has_flag(s_swarm_screen, LV_OBJ_FLAG_HIDDEN)) swarm_picker_rebuild();
+ display_unlock();
+ ESP_LOGI(TAG, "swarms: %d (on %s)", count, s_swarm_selected[0] ? s_swarm_selected : "-");
+}
+
+static void swarm_picker_close(void)
+{
+ if (s_swarm_screen) lv_obj_add_flag(s_swarm_screen, LV_OBJ_FLAG_HIDDEN);
+}
+static void swarm_bg_tap(lv_event_t *e) { (void)e; swarm_picker_close(); }
+
+static void swarm_row_tap(lv_event_t *e)
+{
+ int idx = (int)(intptr_t)lv_obj_get_user_data(lv_event_get_current_target(e));
+ if (idx < 0 || idx >= s_swarm_count) return;
+ char id[SWARM_ID_MAX];
+ snprintf(id, sizeof id, "%s", s_swarms[idx].id);
+ swarm_picker_close();
+ // Re-picking the current one is a no-op the window would also treat as one; skip the round trip.
+ if (strcmp(id, s_swarm_selected) == 0) return;
+ ESP_LOGI(TAG, "swarm pick → %s", id);
+ cable_client_select_swarm(id);
+}
+
+// The rows: the swarm's name, and how many agents it holds under it. The selected one is outlined the
+// way the agent switcher outlines "here". Caller holds the lock.
+static void swarm_picker_rebuild(void)
+{
+ if (!s_swarm_list) return;
+ lv_obj_clean(s_swarm_list);
+ for (int i = 0; i < s_swarm_count; i++) {
+ const cable_swarm_t *w = &s_swarms[i];
+ bool here = strcmp(w->id, s_swarm_selected) == 0;
+ lv_obj_t *row = lv_button_create(s_swarm_list);
+ lv_obj_set_width(row, lv_pct(100));
+ lv_obj_set_height(row, LV_SIZE_CONTENT);
+ lv_obj_set_style_bg_color(row, COL_CARD, 0);
+ lv_obj_set_style_bg_opa(row, here ? LV_OPA_COVER : LV_OPA_60, 0);
+ lv_obj_set_style_radius(row, 16, 0);
+ lv_obj_set_style_border_width(row, here ? 1 : 0, 0);
+ lv_obj_set_style_border_color(row, COL_ACCENT, 0);
+ lv_obj_set_style_shadow_width(row, 0, 0);
+ lv_obj_set_style_pad_hor(row, 16, 0);
+ lv_obj_set_style_pad_ver(row, 10, 0);
+ lv_obj_set_flex_flow(row, LV_FLEX_FLOW_COLUMN);
+ lv_obj_set_flex_align(row, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
+ lv_obj_set_style_pad_row(row, 2, 0);
+ lv_obj_clear_flag(row, LV_OBJ_FLAG_SCROLLABLE);
+ lv_obj_set_user_data(row, (void *)(intptr_t)i);
+ lv_obj_add_event_cb(row, swarm_row_tap, LV_EVENT_CLICKED, NULL);
+
+ lv_obj_t *nm = lv_label_create(row);
+ lv_obj_set_style_text_font(nm, &geist_med_28, 0);
+ lv_obj_set_style_text_color(nm, COL_FG, 0);
+ lv_obj_set_width(nm, lv_pct(100));
+ lv_obj_set_style_text_align(nm, LV_TEXT_ALIGN_CENTER, 0);
+ lv_label_set_long_mode(nm, LV_LABEL_LONG_DOT);
+ lv_label_set_text(nm, w->name[0] ? w->name : "New swarm");
+ lv_obj_t *sub = lv_label_create(row);
+ lv_obj_set_style_text_font(sub, &geist_reg_25, 0);
+ lv_obj_set_style_text_color(sub, COL_MUTED, 0);
+ lv_obj_set_width(sub, lv_pct(100));
+ lv_obj_set_style_text_align(sub, LV_TEXT_ALIGN_CENTER, 0);
+ lv_label_set_text_fmt(sub, "%d agent%s", w->agents, w->agents == 1 ? "" : "s");
+ }
+ if (s_swarm_count == 0) make_label(s_swarm_list, "No swarms — open the app", COL_MUTED, &geist_med_28);
+}
+
+static void swarm_picker_build(void)
+{
+ if (s_swarm_screen) return;
+ s_swarm_screen = lv_obj_create(lv_layer_top());
+ lv_obj_remove_style_all(s_swarm_screen);
+ lv_obj_set_size(s_swarm_screen, lv_pct(100), lv_pct(100));
+ lv_obj_set_pos(s_swarm_screen, 0, 0);
+ lv_obj_set_style_bg_color(s_swarm_screen, COL_BG, 0);
+ lv_obj_set_style_bg_opa(s_swarm_screen, LV_OPA_COVER, 0);
+ lv_obj_add_flag(s_swarm_screen, LV_OBJ_FLAG_CLICKABLE);
+ lv_obj_add_event_cb(s_swarm_screen, swarm_bg_tap, LV_EVENT_CLICKED, NULL);
+ lv_obj_add_flag(s_swarm_screen, LV_OBJ_FLAG_HIDDEN);
+ make_close_pill(s_swarm_screen, swarm_bg_tap, 16);
+ // "Swarms" over the list, in the eyebrow style the Overview uses for its machine name.
+ lv_obj_t *title = lv_label_create(s_swarm_screen);
+ lv_obj_set_style_text_font(title, &geist_reg_20, 0);
+ lv_obj_set_style_text_color(title, COL_DOT_OFF, 0);
+ lv_obj_set_style_text_letter_space(title, 2, 0);
+ lv_label_set_text(title, "SWARMS");
+ lv_obj_align(title, LV_ALIGN_TOP_MID, 0, 62);
+ s_swarm_list = lv_obj_create(s_swarm_screen);
+ lv_obj_remove_style_all(s_swarm_list);
+ lv_obj_set_width(s_swarm_list, SAFE_CONTENT_W);
+ lv_obj_set_height(s_swarm_list, LV_SIZE_CONTENT);
+ lv_obj_set_style_max_height(s_swarm_list, 340, 0); // the end rows stay inside the round face
+ lv_obj_align(s_swarm_list, LV_ALIGN_CENTER, 0, 10);
+ lv_obj_set_flex_flow(s_swarm_list, LV_FLEX_FLOW_COLUMN);
+ lv_obj_set_flex_align(s_swarm_list, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
+ lv_obj_set_style_pad_row(s_swarm_list, 8, 0);
+ lv_obj_set_scroll_dir(s_swarm_list, LV_DIR_VER);
+ lv_obj_set_scrollbar_mode(s_swarm_list, LV_SCROLLBAR_MODE_OFF);
+}
+
+// The swarm line on a tile was tapped. Runs on the LVGL task under its own lock.
+static void swarm_line_tap(lv_event_t *e)
+{
+ (void)e;
+ s_suppress_tap = true; // this press was the line's — not a tap on the tile behind it
+ if (ui_voice_is_active() || display_is_asleep() || lv_screen_active() != scr_projects) return;
+ display_lock();
+ swarm_picker_build();
+ swarm_picker_rebuild();
+ lv_obj_clear_flag(s_swarm_screen, LV_OBJ_FLAG_HIDDEN);
+ overlay_raise(s_swarm_screen); // below the dim, like the switcher — see ui_switch_open
+ lv_obj_scroll_to_y(s_swarm_list, 0, LV_ANIM_OFF);
+ display_unlock();
+ cable_client_list_swarms(); // and ask for a fresh list while it is open
+ ESP_LOGI(TAG, "swarm picker: %d swarms", s_swarm_count);
+}
+
void ui_notif_open(void)
{
if (!s_notif_drawer || s_notif_open) return;
diff --git a/device/esp32-circle/main/ui/ui_screens.h b/device/esp32-circle/main/ui/ui_screens.h
index 317cf0bee..18272b9fb 100644
--- a/device/esp32-circle/main/ui/ui_screens.h
+++ b/device/esp32-circle/main/ui/ui_screens.h
@@ -10,6 +10,7 @@
#include "freertos/task.h" // TaskHandle_t — ui_set_reload_waiter
#include "config_store.h"
#include "../cable_machines.h" // cable_machine_t — the wheel's row, already parsed and diffed
+#include "../cable_client.h" // cable_swarm_t — one of the window's tabs, as the wire carries it
struct cJSON;
@@ -213,6 +214,11 @@ void ui_machine_select_error(const char *machine_id, const char *code, const cha
// Re-render the wheel if it is the visible page.
void ui_machines_refresh(void);
+// --- Swarms (the window's tabs; see the block in ui_screens.c) ---
+// Replace the whole list from one `swarms` frame. `selected` names the one the window has on screen; it
+// is what every tile's swarm line draws. count 0 hides the line. Safe from the reader task.
+void ui_swarms_replace(const cable_swarm_t *rows, int count, const char *selected);
+
// Whether the selected machine is the computer at the other end of this cable. Everything that acts on
// "this desk" — the focus report, the scroll report — asks this first.
bool ui_selected_machine_is_local(void);
diff --git a/device/esp32-circle/sdkconfig.defaults b/device/esp32-circle/sdkconfig.defaults
index f2bb60d3f..6a46ac6cc 100644
--- a/device/esp32-circle/sdkconfig.defaults
+++ b/device/esp32-circle/sdkconfig.defaults
@@ -67,9 +67,11 @@ CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_LV_COLOR_DEPTH_16=y
CONFIG_LV_USE_PERF_MONITOR=n
# Fonts used by ui_screens.c (montserrat_14 default; _22 headers; _30 OTA title; _40 big pairing code).
-# 18 is the Model/Effort pills; 22 was 20% too big on the panel.
+# 18 is the Model/Effort pills; 22 was 20% too big on the panel. 24 is the swarm pill that replaced
+# them — one pill on the band where two sat, so it has the room the pair did not.
CONFIG_LV_FONT_MONTSERRAT_18=y
CONFIG_LV_FONT_MONTSERRAT_22=y
+CONFIG_LV_FONT_MONTSERRAT_24=y
CONFIG_LV_FONT_MONTSERRAT_30=y
CONFIG_LV_FONT_MONTSERRAT_40=y
# Keep a small built-in internal LVGL pool and add a 64KiB PSRAM pool at
diff --git a/docs/specs/cable-protocol.md b/docs/specs/cable-protocol.md
index 1be337740..e7e5cf9b6 100644
--- a/docs/specs/cable-protocol.md
+++ b/docs/specs/cable-protocol.md
@@ -105,6 +105,8 @@ needs no machine component and events for a machine that is not selected are dro
| `agents.list` | — | Send me the tiles. |
| `machines.list` | — | Send me the machine wheel. |
| `machine.select` | `machineId` | The user tapped a row. Always answered — see Machines. |
+| `swarms.list` | — | Send me the window's swarms. |
+| `swarm.select` | `swarmId` | The user picked a swarm. NOT answered directly — see Swarms. |
| `focus` | `agentId` | The carousel settled here. A statement about where the user is LOOKING, not a request to run anything. |
| `scroll` | `phase`, `dy`, `v?` | A finger on the glass, in pieces. The dial is a TOUCHPAD here: it reports MOVEMENT, because it cannot know how tall the window at the other end is. `v` travels only on `up`, and becomes the fling. |
| `turn.send` | `agentId`, `text` | The user asked for something. |
@@ -126,6 +128,7 @@ needs no machine component and events for a machine that is not selected are dro
| `machine.selected` | `machineId` — the switch happened; that machine's agents follow |
| `machine.error` | `machineId`, `code`, `message` — the switch did NOT happen; the selection is unchanged |
| `machine.updated` | one row changed — liveness, a rename, a count |
+| `swarms` | `selected`, `items[]` of `{id,name,agents}` — the window's tabs, whole, whenever they change; empty with no window |
| `ping` | — the heartbeat |
| `agents.begin` / `agent` / `agents.end` | the list, streamed — one agent per message |
| `agent.updated` | one agent changed; the dial re-asks |
@@ -239,6 +242,26 @@ reattaches after a reboot, a replug or a daemon restart gets its tiles back with
Up to three turns per agent are kept: enough for the voice router to tell one agent's subject from
another's, few enough that one chatty agent cannot crowd the others out of the decision.
+## 2b. Swarms
+
+A swarm is one of the desktop window's tabs: a named group of agents arranged on one grid. The window
+owns them — they live in its state file and nowhere else, and the daemon has no opinion about their
+contents. What crosses this wire is the list of names, which one is on screen, and a pick.
+
+The carousel does not need a swarm to walk one. The daemon's ring is already the window's open panes
+(`app_panes` on the local socket → `agents.end.ring`), and the window's open panes ARE the active swarm's,
+so switching tabs in the window has always re-shaped the ring. `swarms` adds the NAME of that tab, drawn
+above the agent on every tile, and `swarm.select` adds the way to pick another from the glass.
+
+`swarm.select` is relayed to the window as `dial_swarm` on the local socket, and the window switches by
+the same path a ⌘] takes. Nothing is answered on the cable: the window re-describes its desk, and the
+`swarms` frame (new `selected`) and the agent list (new ring) that follow are the answer. The dial writes
+nothing optimistically, for the reason the machine wheel's ✓ waits for `machine.selected`.
+
+With a window present, an EMPTY desk means an empty ring — a fresh swarm has no panes, and the carousel
+shows none rather than every agent the window is deliberately not showing. With no window (no `app_swarms`
+ever received, or the socket closed) the old fallback holds: the ring is the whole list.
+
## 3. The session, and how each side knows the other is gone
Over a cable there is no connection to lose: the daemon quitting looks exactly like the daemon having