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.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Round dial: talk to a Swarm's Lead or Buddy wherever it runs, and the Buddy side works (#2232)
0xdiego255fdd1c607bb9
diff --git a/cli/src/cable/cableSession.spec.ts b/cli/src/cable/cableSession.spec.tsindex 921ff16a0..85bfb9602 100644--- a/cli/src/cable/cableSession.spec.ts+++ b/cli/src/cable/cableSession.spec.ts@@ -4856,6 +4856,71 @@ describe('swarm cards', () => {} finally { await session.stop() }})+ // Diego's dial, 2026-10-29: the openharness Lead runs on another Mac, so its card had no local harness and a tap on its+ // face did nothing. Such a Lead is spoken to by its Swarm id, and its words still go only to its chat.+ it('a Lead on another machine is spoken to by its Swarm id: reviewed words post in its chat and nothing is typed', async () => {+ const swarmSay = vi.fn(async (): Promise<SaidOnCard> => ({ said: true }))+ const host = cardHost({ cards: [card('st1', [withBuddy({ local: '', id: 'lead1' })])] },+ { transcribe: vi.fn(async () => 'ship it'), route: vi.fn(), swarmSay, appFocus: () => ({ machineId: 'm1', agentId: 'a2' }) })+ const { session, port } = await connect(host)+ try {+ port.say({ ...BUDDY, swarmReview: 'v1' })+ await vi.waitFor(() => expect(ofType(port, 'supertab')).toHaveLength(1))+ expect(ofType(port, 'welcome')[0].features).toContain('swarm.remote')+ port.say({ t: 'voice.begin', uploadId: 'u-l1', agentId: 'lead1' })+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end', uploadId: 'u-l1', review: true })+ await vi.waitFor(() => expect(ofType(port, 'voice.draft')).toHaveLength(1))+ const draft = ofType(port, 'voice.draft')[0]+ expect(draft).toMatchObject({ name: "Project 1 · diego's Buddy", context: 'Swarm chat', agentId: 'lead1' })+ port.say({ t: 'draft.command', draftId: draft.id, revision: draft.revision, requestId: 'r1', op: 'send' })+ await vi.waitFor(() => expect(ofType(port, 'draft.state')).toHaveLength(1))+ expect(swarmSay.mock.calls).toEqual([['lead1', 'ship it', 'buddy', 'pm1', true]])+ expect(host.sendTurn).not.toHaveBeenCalled()+ } finally { await session.stop() }+ })++ // Review of #2232: a dial still on a remote Lead's face names its Swarm id to a daemon whose cards are not read yet (the+ // devices process just restarted) or no longer hold it. The window's focused pane must not take the words.+ it('a Swarm id with no card here is an error, never the focused pane\'s turn', async () => {+ const swarmSay = vi.fn(async (): Promise<SaidOnCard> => ({ said: false }))+ const host = cardHost({ cards: [] }, { transcribe: vi.fn(async () => 'ship it'), route: vi.fn(), swarmSay,+ appFocus: () => ({ machineId: 'm1', agentId: 'a2' }) })+ const { session, port } = await connect(host)+ try {+ port.say(BUDDY); await settle()+ port.say({ t: 'voice.begin', uploadId: 'u-l1', agentId: '0123456789abcdef01234567' })+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })+ await vi.waitFor(() => expect(ofType(port, 'voice.error')).toHaveLength(1))+ expect(ofType(port, 'voice.error')[0].message).toBe('Could not reach the Swarm. Try again.')+ expect(host.sendTurn).not.toHaveBeenCalled()+ // Held to review, the same: no draft whose Send would say sent while the words went nowhere.+ port.say({ t: 'voice.begin', uploadId: 'u-l2', agentId: '0123456789abcdef01234567' })+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end', uploadId: 'u-l2', review: true })+ await vi.waitFor(() => expect(ofType(port, 'voice.error')).toHaveLength(2))+ expect(ofType(port, 'voice.error')[1].message).toBe('Could not reach the Swarm. Try again.')+ expect(ofType(port, 'voice.draft')).toEqual([])+ } finally { await session.stop() }+ })++ it('words for a Lead on another machine that the Swarm cannot take are an error, never a terminal turn', async () => {+ const chat = { kind: 'lead' as const, id: 'lead-c1', name: 'Lead', working: false }+ for (const swarmSay of [vi.fn(async (): Promise<SaidOnCard> => { throw new Error('offline') }), vi.fn(async (): Promise<SaidOnCard> => ({ said: false }))]) {+ const host = cardHost({ cards: [card('st1', [withBuddy({ local: '', id: 'lead1', chat })])] },+ { transcribe: vi.fn(async () => 'ship it'), route: vi.fn(), swarmSay })+ const { session, port } = await connect(host)+ try {+ port.say(ROUND)+ await vi.waitFor(() => expect(ofType(port, 'supertab')).toHaveLength(1))+ port.say({ t: 'voice.begin', uploadId: 'u-l1', agentId: 'lead1' })+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })+ await vi.waitFor(() => expect(ofType(port, 'voice.error')).toHaveLength(1))+ expect(ofType(port, 'voice.error')[0].message).toBe('Could not reach the Swarm. Try again.')+ expect(swarmSay).toHaveBeenCalledWith('lead1', 'ship it', true, 'lead-c1')+ expect(host.sendTurn).not.toHaveBeenCalled()+ } finally { await session.stop() }+ }+ })+/** 13 Leads (12 are sent), every name at its 48-byte cut, each working in a group with a Buddy; `id(kind, l)` names the ids. */const fullCards = (id: (kind: string, l: number) => string) => {const wide = 'é'.repeat(24) // 48 bytesdiff --git a/cli/src/cable/cableSession.ts b/cli/src/cable/cableSession.tsindex 0b54cd4a2..665a6ea59 100644--- a/cli/src/cable/cableSession.ts+++ b/cli/src/cable/cableSession.ts@@ -187,6 +187,8 @@ function chatLead(l: SwarmLead, chat = l.chat): Record<string, unknown> {function buddyLead(l: SwarmLead): Record<string, unknown> {return { ...chatLead(l, l.sideChat ?? l.chat), ...(l.buddies ? { buddies: true } : {}), ...(l.buddies && l.buddy ? { buddy: { ...l.buddy } } : {}) }}+/** A Swarm agent's id as the backend makes it; a harness's id is a UUID, so the two never meet. */+const SWARM_AGENT_ID = /^[0-9a-f]{24}$//** The byte cuts a name is shortened through, on a character, when a frame would not fit. */const NAME_CUTS = [24, 12, 6, 3, 1, 0]/**@@ -874,7 +876,9 @@ export class CableSession {form?: { command?: FormCommand; pin: Promise<FormResult> };/** The chat on this dial's face for that agent's Swarm project as the person began to speak: the words go there or* nowhere, and a Buddy chat's never reach a terminal (review of #2146). */- swarmFace?: SwarmFace } | null = null+ swarmFace?: SwarmFace;+ /** That Lead runs on another machine: named by its Swarm id, it has no terminal here. */+ swarmRemote?: true } | null = nullprivate voiceSearch?: SelectionCommandprivate voiceForm?: FormCommandprivate voiceCarryId?: string@@ -1349,7 +1353,9 @@ export class CableSession {...(this.host.answerReviewed ? ['question.review'] : []),// Words reviewed on a Swarm face are posted in its chat by Send. A dial asks for review there only when it sees// this: an older daemon would type the reviewed words into the Lead's terminal.- ...(this.host.swarmSay ? ['swarm.review'] : []),+ // swarm.remote: a dial names a Lead on another machine by its Swarm id, which an older daemon would hand to the+ // pane focused in the window.+ ...(this.host.swarmSay ? ['swarm.review', 'swarm.remote'] : []),// The desktop will carry this device's preferences. A device that does not see this keeps// its own settings screens and never reports.'settings',@@ -1726,12 +1732,16 @@ export class CableSession {// Except words for a Swarm face's chat: the dial shows that chat, so a pane focused in the window never takes them.const plain = str('agentId') && !formVoice && !searchVoice && !draftVoice && !questionVoice && !carryVoice && !('selectionId' in msg)const dialFace = plain ? this.swarmFaceOf(str('agentId')!) : undefined- const focused = plain && !dialFace ? this.host.appFocus?.() : undefined+ // A Swarm Lead's id (the backend's 24 hex; a harness's is a UUID) with no card here yet (the devices process just+ // restarted) or any more: words for a Lead on another machine, which the focused pane must not take (review of #2232).+ const swarmId = plain && !dialFace && SWARM_AGENT_ID.test(str('agentId')!)+ const focused = plain && !dialFace && !swarmId ? this.host.appFocus?.() : undefinedconst agentId = focused?.agentId ?? str('agentId')const swarmFace = dialFace ?? (agentId ? this.swarmFaceOf(agentId) : undefined)this.voice = {agentId,...(swarmFace ? { swarmFace } : {}),+ ...((swarmFace && agentId && !this.swarmLeadHere(agentId)) || swarmId ? { swarmRemote: true } : {}),cmd: str('cmd'),lang: str('lang') ?? this.host.voiceLang(),// The DIAL's rate, never this side's guess. Describing 8 kHz audio as 16 kHz does not make the@@ -2356,6 +2366,9 @@ export class CableSession {this.voiceDraftCreation = { uploadId, id: state.id }await reply({ t: 'voice.draft', ...state }); return}+ // A Lead on another machine with no card here: no draft, whose Send would type into no harness and say it was sent+ // (review of #2232).+ if (review && turn.swarmRemote && !turn.swarmFace) { await reply({ t: 'voice.error', message: 'Could not reach the Swarm. Try again.' }); return }if (review) {const recipient = agentIdconst state = this.voiceDraft.create({ agentId: recipient, name: agentName || 'Harness', text: transcript,@@ -2394,7 +2407,8 @@ export class CableSession {}// Words for the reader's Buddy chat (a swarmBuddy dial's Buddy face, an older dial's PM face), which the PM cannot read.if (face?.kind === 'buddy') { await reply({ t: 'voice.error', message: 'Could not reach your Buddy. Try again.' }); return }- if (face?.kind === 'pm') { await reply({ t: 'voice.error', message: 'Could not reach the Swarm. Try again.' }); return }+ // A Lead on another machine has no terminal here to fall back to: its Swarm id names no harness.+ if (face?.kind === 'pm' || turn.swarmRemote) { await reply({ t: 'voice.error', message: 'Could not reach the Swarm. Try again.' }); return }}const text = carried ? withCarriedPassage(instruction, carried): selection?.ok && selection.text ? withSelectedPassage(instruction, selection.text) : instruction@@ -2744,13 +2758,19 @@ export class CableSession {private swarmFaceOf(harnessId: string): SwarmFace | undefined {if (!this.swarmChat) return undefinedfor (const card of this.host.swarmCards?.() ?? []) {- const lead = card.leads.find((l) => l.local === harnessId)+ // A Lead on another machine is named by its Swarm id: its card has no harness here (Diego's dial, 2026-10-29).+ const lead = card.leads.find((l) => l.local === harnessId || (!l.local && l.id === harnessId))const face = lead && (this.swarmBuddy ? lead.sideChat ?? lead.chat : lead.chat)if (lead) return face && { ...face, project: lead.project }}return undefined}+ /** Whether `harnessId` is a Swarm Lead's harness on this machine. */+ private swarmLeadHere(harnessId: string): boolean {+ return (this.host.swarmCards?.() ?? []).some((card) => card.leads.some((l) => l.local === harnessId))+ }+/** The extra arguments of words spoken to a Swarm Lead: the dial's chat flag, and the chat they were spoken to. */private sayArgs(face: SwarmFace | undefined): [chat?: CardChat, chatId?: string] {const [chat] = this.chatFlag()diff --git a/cli/src/core/experimentQueries.spec.ts b/cli/src/core/experimentQueries.spec.tsindex fd816501f..bdda43cd2 100644--- a/cli/src/core/experimentQueries.spec.ts+++ b/cli/src/core/experimentQueries.spec.ts@@ -218,17 +218,21 @@ describe('what an experiment in its own process may ask of the core', () => {expect(await answerExperimentQuery(core, experiments, 'orchestrator', 'observer_key', { op: 'public' })).toEqual({ error: 'odd' })})- it('tells Share which account is signed in here, which its tabs\' observers are derived for, and no other experiment', async () => {+ it('tells Share and the Swarm which account is signed in here, and no other experiment', async () => {const identity = vi.fn(async (): Promise<{ accountId: string; email: string } | null> => ({ accountId: 'u-bob', email: '[email protected]' }))const core = fakeCore({ account: { identity } })const withShare = new Set(['orchestrator', 'sharing'])expect(await answerExperimentQuery(core, withShare, 'sharing', 'account', {})).toEqual({ accountId: 'u-bob', email: '[email protected]' })identity.mockResolvedValueOnce(null)expect(await answerExperimentQuery(core, withShare, 'sharing', 'account', {})).toEqual({ error: 'ACCOUNT_UNAVAILABLE' })+ // And the Swarm, whose round dial cards show the reader's own Buddy (Diego's dial, 2026-10-29: "No Buddy here yet"+ // with a Buddy, since the Swarm's process was answered nothing here).+ const withSwarm = new Set(['superTabs'])+ expect(await answerExperimentQuery(core, withSwarm, 'superTabs', 'account', {})).toEqual({ accountId: 'u-bob', email: '[email protected]' })// Any other service's `account` is its own link's to answer: models asks it for the grid name.expect(await answerExperimentQuery(core, withShare, 'orchestrator', 'account', {})).toBeNull()expect(await answerExperimentQuery(core, withShare, 'models', 'account', {})).toBeNull()- expect(identity).toHaveBeenCalledTimes(2)+ expect(identity).toHaveBeenCalledTimes(3)})it('sends Share\'s sealed frame to one of its observers, and nothing that is not one', async () => {diff --git a/cli/src/core/experimentQueries.ts b/cli/src/core/experimentQueries.tsindex 8f684f06f..f37848dc6 100644--- a/cli/src/core/experimentQueries.ts+++ b/cli/src/core/experimentQueries.ts@@ -77,9 +77,11 @@ export function answerMachineAddonsQuery(core: Pick<CoreApi, 'daemon'>, service:export async function answerExperimentQuery(core: Core, experiments: ReadonlySet<string>, service: string, query: string, payload: Payload): Promise<Payload | null> {if (!QUERIES.has(query)) return null// `account` is also what models asks for the account's grid name, of its own link (core/modelsLink.ts): only- // Share's is answered here. Seen 2026-10-18: since #1376 models got NOT_AN_EXPERIMENT back instead, so the- // backend's grid name never reached it, and the picker said "Sign in to find models" to a signed-in person.- if (query === 'account' && service !== 'sharing') return null+ // Share's and the Swarm's are answered here. Seen 2026-10-18: since #1376 models got NOT_AN_EXPERIMENT back instead, so+ // the backend's grid name never reached it, and the picker said "Sign in to find models" to a signed-in person. The+ // Swarm's round dial cards need the reader to find their own Buddy: answered nothing, the dial said "No Buddy here+ // yet" to a person with one (Diego's dial, 2026-10-29).+ if (query === 'account' && service !== 'sharing' && service !== 'superTabs') return nullif (!experiments.has(service)) return { error: 'NOT_AN_EXPERIMENT' }switch (query) {case 'shown':diff --git a/cli/src/superTabs/cards.spec.ts b/cli/src/superTabs/cards.spec.tsindex ef833a484..2c07091b8 100644--- a/cli/src/superTabs/cards.spec.ts+++ b/cli/src/superTabs/cards.spec.ts@@ -458,6 +458,17 @@ describe('SwarmCards.say', () => {expect(t.call.mock.calls.filter(c => c[0] === 'POST')).toHaveLength(1)})+ // Diego's dial, 2026-10-29: a Lead on another machine has no harness here, so the dial names it by its Swarm id.+ it('posts words for a Lead on another machine, named by its Swarm id, in its conversation as the person', async () => {+ const t = setup({ t1: { lastChangedAt: 1, state: swarm({ agents: [agent('a1', { machineId: 'm2' }), agent('a2')] }) } })+ await t.cards.tick()+ expect(await t.cards.say('a1', 'ship it')).toEqual({ said: true })+ const post = t.call.mock.calls.find(c => c[0] === 'POST')!+ expect(post[2]).toMatchObject({ command: { type: 'message.send', conversationId: 'lead-web', text: 'ship it' } })+ expect(post[2]).not.toHaveProperty('asAgentId')+ expect(await t.cards.say('zz', 'x')).toEqual({ said: false })+ })+// A refused post was typed into the Lead's terminal instead (spec 2026-10-29 Voice): the dial is told the refusal now.it('say reports a 403 as refused with the backend\'s message', async () => {let answer = { status: 403, body: { success: false, error: { code: 'PM_CHAT_READ_ONLY', message: 'Chat with PM is read-only.' } } }diff --git a/cli/src/superTabs/cards.ts b/cli/src/superTabs/cards.tsindex e7e94302d..f50c6a638 100644--- a/cli/src/superTabs/cards.ts+++ b/cli/src/superTabs/cards.ts@@ -572,7 +572,8 @@ export class SwarmCards {* see (docs/device-voice-swarm-chat.md); the backend checks the post as for typing. */async say(harnessId: string, text: string, chat: CardChat = false, chatId?: string, reviewed = false): Promise<SaidOnCard> {for (const [tabId, { state }] of this.tabs) {- const agent = list(state.agents).find(a => a.machineId === this.machineId && a.harnessId === harnessId)+ // A Lead on another machine has no harness here, so the dial names it by its Swarm id (Diego's dial, 2026-10-29).+ const agent = list(state.agents).find(a => (a.machineId === this.machineId && a.harnessId === harnessId) || a.id === harnessId)const found = agent && cardId(agent.id) ? this.target(tabId, agent.id, chat) : nullif (!found) continueconst to = chatId === undefined || found.id === chatId ? found.iddiff --git a/devices/harness-device/firmware/main/cable_client.c b/devices/harness-device/firmware/main/cable_client.cindex 776cb37cc..41ebd2235 100644--- a/devices/harness-device/firmware/main/cable_client.c+++ b/devices/harness-device/firmware/main/cable_client.c@@ -327,9 +327,8 @@ static void send_hello(void)// A PM and a Buddy side per Swarm (spec 2026-10-29-round-dial-pm-buddy): each Lead's `buddies` and the reader's// Buddy, a face that may be the Buddy chat, its quiet notice, and `supertab.side` back. Older daemons ignore it.msg_string(&root, "swarmBuddy", "v1");- // Words for a Swarm chat are always reviewed here (Send or Discard) before they are posted, as everyone in the Swarm- // reads them; the daemon refuses any that come unreviewed (docs/device-voice-swarm-chat.md).- msg_string(&root, "swarmReview", "v1");+ // No swarmReview: words for a Swarm chat are sent as any harness's are and reviewed only when held (Diego's dial,+ // 2026-10-29), and a daemon that heard it would refuse every word not reviewed (docs/device-voice-swarm-chat.md).// Which of the two dials this is (board.h) — informational, so a log or a bug report can say. A// daemon that predates the field ignores it.msg_string(&root, "hw", board()->name);diff --git a/devices/harness-device/firmware/main/cable_features.c b/devices/harness-device/firmware/main/cable_features.cindex 3c9873a1b..7e410e4b8 100644--- a/devices/harness-device/firmware/main/cable_features.c+++ b/devices/harness-device/firmware/main/cable_features.c@@ -11,7 +11,7 @@ uint32_t cable_features_parse(const cJSON *welcome){"visit", CABLE_FEATURE_VISIT}, {"voice.draft", CABLE_FEATURE_DRAFT},{"question.review", CABLE_FEATURE_QUESTIONS},{"agents.refresh", CABLE_FEATURE_AGENTS_REFRESH},- {"settings", CABLE_FEATURE_SETTINGS}, {"swarm.review", CABLE_FEATURE_SWARM_REVIEW},+ {"settings", CABLE_FEATURE_SETTINGS}, {"swarm.review", CABLE_FEATURE_SWARM_REVIEW}, {"swarm.remote", CABLE_FEATURE_SWARM_REMOTE},};uint32_t result = 0;const cJSON *item;diff --git a/devices/harness-device/firmware/main/cable_features.h b/devices/harness-device/firmware/main/cable_features.hindex 5adf033d1..3b95a1bc7 100644--- a/devices/harness-device/firmware/main/cable_features.h+++ b/devices/harness-device/firmware/main/cable_features.h@@ -16,6 +16,9 @@ enum {// Words reviewed on a Swarm face are posted in its chat by Send. Without it a reviewed draft would be typed into the// Lead's terminal, so a Swarm face never asks an older daemon for review.CABLE_FEATURE_SWARM_REVIEW = 1u << 7,+ // A Lead on another machine may be named by its Swarm id: the daemon posts the words in its chat. An older daemon would+ // hand that id to the pane focused in the window, so without it such a Lead is named to no one.+ CABLE_FEATURE_SWARM_REMOTE = 1u << 8,};// Optional welcome field. Older daemons omit it and retain the core voice,diff --git a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.cindex fad1e5d0b..4a902154a 100644--- a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c+++ b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c@@ -614,6 +614,11 @@ static EXT_RAM_BSS_ATTR struct {// The voice turn on the face was started on the Buddy side: its ring and "Sending to your Buddy", pinned at the start as// its chat and engine are, so a side change while it records or sends never says another chat (batch check, #2207).bool voice_buddy;+ // When the finger began its vertical drag on a Swarm's face (0: not yet): a drag that outlasts a flick scrolls.+ uint32_t drag_at;+ // The daemon was told the Lead on the face (supertab.open) on this link: one that came back is told again, or a drag+ // scrolled the focused pane and no recap came (review of #2232).+ bool opened;} sw;static bool swarm_mode(void){@@ -738,13 +743,14 @@ static void swarm_show(const ht_supertab_t *t, int i, bool select)swarm_buddy_seen();swarm_send(SUPERTAB_OPEN, t->id, sw.lead);swarm_send(SUPERTAB_RECAP_GET, t->id, sw.lead);+ sw.opened = true;change();}static void swarm_leave(void){if (!swarm_mode()) return;swarm_send(SUPERTAB_OPEN, sw.tab, "");- sw.tab[0] = sw.lead[0] = sw.desk[0] = 0; sw.at = 0;+ sw.tab[0] = sw.lead[0] = sw.desk[0] = 0; sw.at = 0; sw.opened = false;ht_supertabs_recap_open(&swarm, "", "", ms());change();}@@ -1489,9 +1495,20 @@ static void render_swarm_face(ht_scene_t *f)// The avatar stands where the pet does on Focus, at 233, 158 or higher: 8 px clear of the recap's card, which keeps// today's place (it rises with its lines). A creature skin keeps its creature.if (focus_face) {+ // And of any line the face writes under it instead: with no recap, "Tap the name to switch panes" stood under+ // the disc (Diego's dial, 2026-10-29).int cy = 158;- for (int i = 0; i < f->count; i++)- if (f->runs[i].box.h && f->runs[i].w >= 300 && f->runs[i].y - 8 - 46 < cy) cy = f->runs[i].y - 8 - 46;+ for (int i = 0; i < f->count; i++) {+ const ht_run_t *r = &f->runs[i];+ int top = r->y;+ if (r->box.h && r->w >= 300) {}+ else if (r->text[0] && !r->arc && r->y >= 90 && r->y <= 380) {+ ht_rect_t b = ht_run_bounds(r);+ if (b.x >= 279 || b.x + b.w <= 187) continue;+ top = b.y;+ } else continue;+ if (top - 8 - 46 < cy) cy = top - 8 - 46;+ }face_buddy_disc(f, 233, cy, 92, mix_black(l->buddy.color, 16));ht_cell_sprite(f, 208, cy - 25, face_buddy_avatar(l->buddy.cells, l->buddy.color));}@@ -2710,6 +2727,16 @@ static bool carry_emit(const ht_carry_command_t *c, void *ctx)COPY(a.id,c->agent); copy(a.text,48,c->id); copy(a.text+48,48,c->selection);return xQueueSend(actions,&a,0)==pdPASS;}+// Whom a voice turn on the Swarm face names: the Lead's harness here, or, for a Lead on another machine, its Swarm id,+// whose chat the daemon posts the words in (Diego's dial, 2026-10-29: the openharness Lead ran on another Mac and a tap+// on its face did nothing). An older daemon would hand that id to the pane focused in the window: then no one.+static const char *swarm_voice_id(void)+{+ const ht_lead_t *l = swarm_lead();+ if (!l) return "";+ if (l->local[0]) return l->local;+ return cable_client_supports(CABLE_FEATURE_SWARM_REMOTE) ? l->id : "";+}static action_t make_action(hit_t h){action_t a = {.kind = h.action, .value = h.value, .revision = s.q.revision};@@ -2749,7 +2776,7 @@ static action_t make_action(hit_t h)} else if (h.action == A_DESKTOP && h.value == 1)COPY(a.id, s.q.agent);else if (swarm_mode())- COPY(a.id, swarm_lead() ? swarm_lead()->local : ""); // a remote Lead has none: nothing to talk to+ COPY(a.id, swarm_voice_id());else if (active())COPY(a.id, active()->id);return a;@@ -2831,11 +2858,12 @@ static void draft_move(int delta, uint32_t now)change();}}-// The Lead a face voice turn goes to: the one on the face, when `id` is its local harness.+// The Lead a face voice turn goes to: the one on the face, when `id` is its local harness or, for a Lead on another+// machine, its Swarm id.static const ht_lead_t *voice_lead(const char *id, int value){const ht_lead_t *l = value == 0 || value == 1 ? swarm_lead() : NULL;- return l && l->local[0] && !strcmp(l->local, id) ? l : NULL;+ return l && id[0] && (!strcmp(l->local, id) || (!l->local[0] && !strcmp(l->id, id))) ? l : NULL;}static void dispatch(action_t a){@@ -3115,10 +3143,12 @@ static void dispatch(action_t a)break;case A_VOICE_STOP:if (s.voice_open && !s.voice_start_pending && !s.voice_waiting && audio_client_recording()) {- // Words for a Swarm chat are always reviewed, by a daemon that posts the draft there; an older one would type- // it into the Lead's terminal, so a Swarm face is never held to review with it.+ // Words for a Swarm chat go as any harness's do: reviewed only when held (Diego's dial, 2026-10-29: "like the+ // other agents"; they were always reviewed). Only a daemon that posts a reviewed draft in the chat reviews them:+ // an older one would type it into the Lead's terminal.bool swarm_review = cable_client_supports(CABLE_FEATURE_DRAFT | CABLE_FEATURE_SWARM_REVIEW);- if (s.voice_swarm ? swarm_review : a.value == 1 && cable_client_supports(CABLE_FEATURE_DRAFT) && !s.voice_search && (s.voice_return == HOME || s.voice_return == AGENT || s.voice_return == SELECTION)) {+ if (a.value == 1 && cable_client_supports(CABLE_FEATURE_DRAFT) && !s.voice_search && (s.voice_return == HOME || s.voice_return == AGENT || s.voice_return == SELECTION) &&+ (!s.voice_swarm || swarm_review)) {s.voice_review = true; audio_client_request_review();}audio_client_stop();@@ -3463,6 +3493,15 @@ static void worker(void *unused)}}}+// A Swarm's face, with its Lead open on the daemon: what a drag there scrolls is that Swarm's chat on the desktop (Diego's+// dial, 2026-10-29: scrolling the recap did not scroll the chat). Only once the drag has moved for 250 ms: a flick is+// shorter, and stays the side's, after any rest before it (review of #2232).+static bool swarm_scroll_reportable(uint32_t held)+{+ // And only once the daemon has the Lead open: before, it would hand the drag to the focused pane (review of #2232).+ return held >= 250 && s.ready && s.connected && !s.loading && (s.view == HOME || s.view == AGENT) && swarm_mode() &&+ swarm_lead() && sw.opened && !display_is_asleep() && !s.voice_open && !audio_client_active();+}void habitat_touch(bool down, int x, int y, uint32_t now){#ifdef DEVICE_CREATURE_GALLERY@@ -3486,6 +3525,7 @@ void habitat_touch(bool down, int x, int y, uint32_t now)sw.auto_tabs = false; sw.lost.tab[0] = 0; // the person's TABS from here on, and no Swarm comes back over its.touch_cancelled = false;s.touch_brake = s.coasting && (int32_t)(now - s.coast_until) < 0;+ sw.drag_at = 0;s.coasting = false;ht_scroll_cancel(&scroll);scroll = (ht_scroll_t){0};@@ -3527,6 +3567,10 @@ void habitat_touch(bool down, int x, int y, uint32_t now)ht_scroll_cancel(&scroll);}} else ht_scroll_begin(&scroll, x, y, now, scroll_reversed, scroll_emit, NULL);+ } else if (s.touch_brake && surface && swarm_scroll_reportable(250)) {+ // A touch stops a Swarm chat's fling on the desktop, as it does a terminal's.+ ht_scroll_begin(&scroll, x, y, now, scroll_reversed, scroll_emit, NULL);+ ht_scroll_cancel(&scroll);}} else if (down && !s.touch_cancelled) {ht_gesture_move(&gesture, x, y);@@ -3552,7 +3596,15 @@ void habitat_touch(bool down, int x, int y, uint32_t now)int travel = (s.last_y - y) * (scroll_reversed ? -1 : 1);ht_selection_move(&selection, travel, now);change();- } else ht_scroll_move(&scroll, x, y, now);+ } else {+ // A Swarm's face scrolls the Swarm chat the desktop has open (the daemon names its tab), once a vertical drag+ // has outlasted a flick: a quick flick up or down is still the side's (swarm_side_swipe) and sends nothing.+ if (gesture.axis == 1 && !sw.drag_at) sw.drag_at = now | 1; // | 1: 0 is "not yet", so it may be now + 1+ uint32_t dragged = sw.drag_at && (int32_t)(now - sw.drag_at) > 0 ? now - sw.drag_at : 0;+ if (!scroll.live && surface && gesture.axis == 1 && swarm_scroll_reportable(dragged))+ ht_scroll_begin(&scroll, x, y, now, scroll_reversed, scroll_emit, NULL);+ ht_scroll_move(&scroll, x, y, now);+ }if (gesture.moved && s.pressed >= 0) {s.pressed = -1;if ((!surface && s.view != VOICE) || home_footer(pressed_action.kind)) change();@@ -4113,6 +4165,7 @@ void ui_set_connected(bool value){display_lock();if (!value) {+ sw.opened = false;desktop_companion = HT_CHARACTER_COUNT;desktop_identity=(ui_companion_t){.colour=-1}; companion_celebrating=false;select_companion();@@ -5223,8 +5276,25 @@ bool ui_supertab(const ht_supertab_t *in)if (t && !strcmp(t->id, in->id)) {// The face keeps its Lead; a Lead that went leaves the face on the one now at its place.int i = swarm_lead_index(t, sw.lead);- if (i >= 0) sw.at = i;- else if (t->lead_n) swarm_show(t, sw.at < t->lead_n ? sw.at : t->lead_n - 1, false);+ if (i >= 0) {+ sw.at = i;+ if (!sw.opened) {+ sw.retried = false;+ ht_supertabs_recap_open(&swarm, t->id, sw.lead, ms());+ swarm_send(SUPERTAB_OPEN, t->id, sw.lead);+ swarm_send(SUPERTAB_RECAP_GET, t->id, sw.lead);+ sw.opened = true;+ } else+ // The face's chat moved (a side the daemon took, the desktop) and what is held is another chat's: asked for+ // again. That chat's recap can come before this frame, and is refused as another chat's (a card is held 300 ms,+ // a recap is not): the Buddy side showed no last message (Diego's dial, 2026-10-29).+ if ((swarm.recap.state == HT_RECAP_LOADED || swarm.recap.state == HT_RECAP_EMPTY) && !strcmp(swarm.recap.lead, sw.lead) &&+ strcmp(swarm.recap.chat_id, t->leads[i].chat_id)) {+ sw.retried = false;+ ht_supertabs_recap_open(&swarm, t->id, sw.lead, ms());+ swarm_send(SUPERTAB_RECAP_GET, t->id, sw.lead);+ }+ } else if (t->lead_n) swarm_show(t, sw.at < t->lead_n ? sw.at : t->lead_n - 1, false);else swarm_show(t, -1, false);swarm_buddy_seen();}diff --git a/devices/harness-device/firmware/test/test_cable_features.c b/devices/harness-device/firmware/test/test_cable_features.cindex 50ee2eadb..a98bd0694 100644--- a/devices/harness-device/firmware/test/test_cable_features.c+++ b/devices/harness-device/firmware/test/test_cable_features.c@@ -32,6 +32,7 @@ int main(void)check("{\"features\":[\"form\",[\"visit\"]]}", 0);check("{\"features\":[\"agents.refresh\"]}", CABLE_FEATURE_AGENTS_REFRESH);check("{\"features\":[\"swarm.review\"]}", CABLE_FEATURE_SWARM_REVIEW);+ check("{\"features\":[\"swarm.remote\"]}", CABLE_FEATURE_SWARM_REMOTE);static const char *names[] = {"form", "selection", "visit", "voice.draft", "question.review", "agents.refresh"};for (unsigned mask=0; mask<64; mask++) {cJSON *root=cJSON_CreateObject(), *array=cJSON_AddArrayToObject(root,"features");diff --git a/devices/harness-device/firmware/test/test_cable_supertab.py b/devices/harness-device/firmware/test/test_cable_supertab.pyindex c4e966deb..e2d6e13e1 100644--- a/devices/harness-device/firmware/test/test_cable_supertab.py+++ b/devices/harness-device/firmware/test/test_cable_supertab.py@@ -117,8 +117,9 @@ int main(void) {assert(!strcmp(field(wire[0],"swarmChat"),"v1"));// and swarmBuddy v1: each Lead's Buddy block, a Buddy face and the Buddy's quiet notice.assert(!strcmp(field(wire[0],"swarmBuddy"),"v1"));- // hello says swarmReview v1: words for a Swarm chat are always reviewed here, so the daemon refuses any that are not.- assert(!strcmp(field(wire[0],"swarmReview"),"v1"));+ // and no swarmReview: words for a Swarm chat are sent as any harness's are, reviewed only when held (Diego's dial,+ // 2026-10-29), and a daemon that heard it would refuse every word not reviewed.+ assert(!strcmp(field(wire[0],"swarmReview"),"<absent>"));// supertabs: ids in order, the bad and the repeated skipped, at most 16.feed(handle_supertabs,"{\"ids\":[\"s1\",\"\",7,\"s2\",\"s1\",\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"]}");diff --git a/devices/harness-device/firmware/test/test_touch_ui.py b/devices/harness-device/firmware/test/test_touch_ui.pyindex cb629b7c9..70796b5cb 100644--- a/devices/harness-device/firmware/test/test_touch_ui.py+++ b/devices/harness-device/firmware/test/test_touch_ui.py@@ -228,7 +228,7 @@ swarm_parts = {# with the last `swarms` list it keeps beside it'swarms_apply': source[source.index('// The last `swarms` list as it came'):source.index('void ui_swarms_replace(')],}-for name in ['copy', 'recap_preview', 'notice_unread', 'notice_was_read', 'notice_forget_read', 'notice_flush_reads', 'notice_mark_read', 'habitat_scene_receipt', 'habitat_scene_presented', 'pane_memory', 'pane_memory_apply', 'dismiss_result', 'activity_text', 'ensure', 'input_cancel', 'view', 'notice_open', 'workspace_index', 'swarm_core', 'voice_lead', 'tabs_open', 'workspace_failed', 'tab_request', 'tabs_sync', 'ui_scroll_reportable', 'focus_skin', 'focus_face_for', 'focus_chord', 'focus_put', 'focus_span', 'focus_take', 'focus_rows', 'ui_rows', 'ui_can_display', 'ui_wrap', 'text_in', 'control', 'home_footer', 'footer_control', 'text', 'center', 'render_brand', 'heading', 'question_view', 'question_rows', 'question_move', 'question_text', 'render_question', 'render_choices', 'render_answer_review', 'question_answer', 'send_answer', 'make_action', 'character_mood', 'voice_status', 'home_caption_rotates', 'home_caption_tick', 'status_animated', 'status_speed', 'status_wake_ms', 'surface_tick', 'command_face', 'render_workspace_preview', 'question_prompt', 'focus_bell', 'mix_black', 'face_buddy_disc', 'face_buddy_ring', 'face_buddy_dots', 'face_buddy_avatar', 'render_buddy_empty', 'render_swarm_face', 'render_home', 'render_voice', 'render_selection', 'render_form', 'draft_move', 'render_draft', 'render_draft_options', 'swarms_apply', 'ui_swarms_replace', 'ui_workspace_applied', 'ui_land_after_reload']:+for name in ['copy', 'recap_preview', 'notice_unread', 'notice_was_read', 'notice_forget_read', 'notice_flush_reads', 'notice_mark_read', 'habitat_scene_receipt', 'habitat_scene_presented', 'pane_memory', 'pane_memory_apply', 'dismiss_result', 'activity_text', 'ensure', 'input_cancel', 'view', 'notice_open', 'workspace_index', 'swarm_core', 'swarm_voice_id', 'voice_lead', 'tabs_open', 'workspace_failed', 'tab_request', 'tabs_sync', 'ui_scroll_reportable', 'focus_skin', 'focus_face_for', 'focus_chord', 'focus_put', 'focus_span', 'focus_take', 'focus_rows', 'ui_rows', 'ui_can_display', 'ui_wrap', 'text_in', 'control', 'home_footer', 'footer_control', 'text', 'center', 'render_brand', 'heading', 'question_view', 'question_rows', 'question_move', 'question_text', 'render_question', 'render_choices', 'render_answer_review', 'question_answer', 'send_answer', 'make_action', 'character_mood', 'voice_status', 'home_caption_rotates', 'home_caption_tick', 'status_animated', 'status_speed', 'status_wake_ms', 'surface_tick', 'command_face', 'render_workspace_preview', 'question_prompt', 'focus_bell', 'mix_black', 'face_buddy_disc', 'face_buddy_ring', 'face_buddy_dots', 'face_buddy_avatar', 'render_buddy_empty', 'render_swarm_face', 'render_home', 'render_voice', 'render_selection', 'render_form', 'draft_move', 'render_draft', 'render_draft_options', 'swarms_apply', 'ui_swarms_replace', 'ui_workspace_applied', 'ui_land_after_reload']:code += swarm_parts[name] if name in swarm_parts else function(name)code += function('render_settings') + function('ui_visit_state')code += function('ui_project_known') + function('ui_focus_project') + function('ui_apply_pending_focus')@@ -311,7 +311,7 @@ static void dispatch(action_t a) {} else if (a.kind == A_SELECT_EXTEND) ht_selection_extend(&selection,3000);}'''-code += function('habitat_touch') + function('habitat_touch_cancel') + function('habitat_next_wake_ms')+code += function('swarm_scroll_reportable') + function('habitat_touch') + function('habitat_touch_cancel') + function('habitat_next_wake_ms')code += 'static bool audio_client_active(void);\n' + function('ui_boot_pressed')code += r'''static ht_scene_t scene;@@ -1559,11 +1559,14 @@ static void swarm_pane_checks(const char *dir) {assert(asking_n && done_n && other);openharness_card(); card_send();}- // 2e "backend" on someone else's machine, working: "Working…" and no time; a tap on the face talks to nobody.+ // 2e "backend" on someone else's machine, working: "Working…" and no time. A tap on the face talks to it by its Swarm+ // id, to a daemon that posts such words in its chat (Diego's dial, 2026-10-29); to an older one, to nobody.enter_at("s1", "L4"); assert(title_is("backend") && scene_says("Working") && !scene_says(":"));FOCUS_PAGE("swarm-2e");// (the real dispatch drops a face voice turn with no recipient: test_voice_ui.py)assert(!make_action((hit_t){.action = A_VOICE}).id[0]);+ { uint32_t was = host_features; host_features |= CABLE_FEATURE_SWARM_REMOTE;+ assert(!strcmp(make_action((hit_t){.action = A_VOICE}).id, "L4")); host_features = was; }enter_at("s1", "L0"); assert(!strcmp(make_action((hit_t){.action = A_VOICE}).id, "h0"));tap(fake_ms, 233, 260); assert(!strcmp(target, "h0")); dispatch((action_t){.kind = A_VOICE_ABORT});enter_at("s1", "L4");@@ -2016,6 +2019,12 @@ static void buddy_setup(void) {static void swipe_v(int from_y, int to_y) {fake_ms += 1000; habitat_touch(true, 233, from_y, fake_ms); habitat_touch(false, 233, to_y, fake_ms + 120); scene_take();}+// A drag: held 660 ms, moving all the while, as a reading thumb does.+static void drag_v(int from_y, int to_y) {+ fake_ms += 1000; habitat_touch(true, 233, from_y, fake_ms);+ for (int i = 1; i <= 10; i++) habitat_touch(true, 233, from_y + (to_y - from_y) * i / 10, fake_ms + 60 * (uint32_t)i);+ habitat_touch(false, 233, to_y, fake_ms + 660); scene_take();+}static void swipe_up(void) { swipe_v(330, 150); }static void swipe_down(void) { swipe_v(150, 330); }static void swipe_next(void) {@@ -2055,6 +2064,20 @@ static bool avatar(void) {if (!a || !disc_at(233, a->y + 25, 92, 0x221b19)) return false;return !card_top() || a->y + 25 + 46 + 8 <= card_top();}+// Nothing written in the middle of the glass under the avatar's disc and its 8 px: "Tap the name to switch panes" stood+// under it with no recap (Diego's dial, 2026-10-29).+static bool clear_of_text(void) {+ const ht_run_t *a = avatar_sprite();+ if (!a) return false;+ int bottom = a->y + 25 + 46 + 8;+ for (int i = 0; i < scene.count; i++) {+ const ht_run_t *r = &scene.runs[i];+ if (!r->text[0] || r->arc || r->y < 90 || r->y > 380) continue;+ ht_rect_t b = ht_run_bounds(r);+ if (b.x < 279 && b.x + b.w > 187 && b.y < bottom) return false;+ }+ return true;+}static bool pm_dots(void) { return disc_at(442, 218, 12, 0xeaeaf0) && disc_at(442, 248, 9, 0x55565f); }static bool buddy_dots(void) { return disc_at(442, 218, 9, 0x55565f) && disc_at(442, 248, 12, 0xc49bff); }static bool any_dot(void) { return disc_at(442, 218, 12, 0xeaeaf0) || disc_at(442, 218, 9, 0x55565f); }@@ -2065,14 +2088,44 @@ static void swarm_buddy_checks(const char *dir) {assert(title_is("web-api") && pm_dots() && !lilac_ring() && !avatar());FOCUS_PAGE("buddy-7a");int pm_runs = scene.count;+ // A drag held past a flick scrolls the Swarm chat the desktop has open, and the side stays (Diego's dial, 2026-10-29:+ // scrolling the recap did not scroll the chat). The daemon sends it to the Swarm the dial has open.+ drag_v(330, 150);+ assert(down_reports == 1 && moves > 0 && ups == 1 && travel != 0);+ assert(!swarm_sent && pm_dots() && !lilac_ring());+ // A tap while that fling coasts on the desktop stops it there (review of #2232: the tap was swallowed and the chat+ // kept scrolling).+ { int before = down_reports; habitat_touch(true, 233, 260, fake_ms + 700); habitat_touch(false, 233, 260, fake_ms + 760);+ assert(down_reports == before + 1); }+ // A thumb that rests before it flicks still switches the side: the drag's time runs from when it starts to move.+ buddy_setup(); down_reports = moves = ups = 0;+ fake_ms += 1000; habitat_touch(true, 233, 330, fake_ms); habitat_touch(true, 233, 330, fake_ms + 400);+ habitat_touch(true, 233, 240, fake_ms + 450); habitat_touch(false, 233, 150, fake_ms + 500); scene_take();+ assert(!moves && swarm_sent == 1 && !strcmp(swarm_wire[0], "side s1 buddy") && lilac_ring());+ // A daemon that came back has forgotten the Lead open here (the dial's link dropped, as ui_set_connected(false)+ // leaves it): the next frame tells it again, so a drag scrolls its Swarm and recaps reach the face (review of #2232).+ buddy_setup(); sw.opened = false;+ // Until then the daemon has no Lead open, and would hand a drag to the focused pane: none is sent.+ drag_v(330, 150); assert(!moves && !ups);+ buddy_card("lead");+ assert(wire_has(0, "open s1 B0") && wire_has(0, "recap.get s1 B0"));+ { int n = swarm_sent; buddy_card("lead"); assert(swarm_sent == n); }+ buddy_setup();+ // The PM chat's recap is on the face.+ ui_supertab_recap("s1", "B0", "lead-web", "Merged.", 1792560000u, false); scene_take(); assert(scene_says("Merged."));// 7b swipe up: the dial says so, and draws the Buddy side at once: the ring, the avatar, the lower dot lit.swipe_up();- // A Swarm's face is no pane's terminal: the drag scrolls nothing (it used to scroll the pane still active behind it).+ // A flick is the side's: it scrolls nothing (it used to scroll the pane still active behind it).assert(!down_reports && !moves && !ups);assert(swarm_sent == 1 && !strcmp(swarm_wire[0], "side s1 buddy"));assert(s.view == HOME && title_is("web-api") && lilac_ring() && avatar() && buddy_dots());+ // The Buddy chat's recap can come before the frame that puts that chat on the face (a card is held 300 ms, a recap is+ // not), and is refused as another chat's. The frame then asks for it again: the Buddy side showed no last message+ // (Diego's dial, 2026-10-29).+ ui_supertab_recap("s1", "B0", "b0", "Too early.", 1792560000u, false);// The daemon puts the Buddy chat on the face; its recap is the Buddy's last message.buddy_card("buddy");+ assert(swarm_sent == 2 && !strcmp(swarm_wire[1], "recap.get s1 B0"));ui_supertab_recap("s1", "B0", "b0", "Two ways: cache the read, or move it to the host. I'd cache it.", 1792560000u, false); scene_take();assert(scene_says("Two ways") && lilac_ring() && avatar());// Without a recap it stands at 233, 158 exactly.@@ -2084,8 +2137,9 @@ static void swarm_buddy_checks(const char *dir) {// With the bell too (an unread notice off the face) every run still fits the scene.assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "Flashed.", 1792560001u));scene_take(); assert(avatar() && scene.count < HT_RUNS);- ui_supertab_recap("s1", "B0", "b0", "", 1792560000u, true); scene_take();- assert(avatar() && avatar_sprite()->y == 133);+ ui_supertab_recap("s1", "B0", "b0", "", 1792560000u, true);+ // Nothing said yet: whatever the face writes instead stands clear of the avatar, at any of its captions.+ for (int k = 0; k < 40; k++) { fake_ms += 9000; scene_take(); assert(avatar() && clear_of_text()); }ui_supertab_recap("s1", "B0", "b0", "Two ways: cache the read, or move it to the host. I'd cache it.", 1792560000u, false); scene_take();}FOCUS_PAGE("buddy-7b");@@ -2103,7 +2157,7 @@ static void swarm_buddy_checks(const char *dir) {#undef AV}// Swipe up on the Buddy side does nothing.- swipe_up(); assert(swarm_sent == 1 && lilac_ring());+ swipe_up(); assert(swarm_sent == 2 && lilac_ring());// The next project keeps the side, and the dial says it again with the move.swipe_next();assert(!strcmp(sw.lead, "B1") && title_is("firmware") && lilac_ring() && avatar() && wire_has(1, "side s1 buddy") && wire_has(1, "select s1 B1"));diff --git a/devices/harness-device/firmware/test/test_voice_ui.py b/devices/harness-device/firmware/test/test_voice_ui.pyindex 6c681da68..bf532f952 100644--- a/devices/harness-device/firmware/test/test_voice_ui.py+++ b/devices/harness-device/firmware/test/test_voice_ui.py@@ -121,6 +121,7 @@ bool queue(action_t action) { if (queue_full) return false; queued = action; ret'''# The Swarm's data and lookups, for the Lead a face voice turn goes to.harness += source[source.index('enum { SUPERTAB_RECAP_GET'):source.index('static const char *swarm_fixed_text(')]+harness += function('swarm_voice_id')harness += function('voice_lead')# and whose engine it listens with: the Buddy's on a Swarm's Buddy side.for name in ['swarm_side_slot', 'swarm_side_buddy', 'swarm_on_buddy', 'swarm_voice_engine']:@@ -168,9 +169,14 @@ int main(void) {assert(!strcmp(s.voice_engine, "codex") && !strcmp(s.voice_target, "mobile") && !sw.voice_buddy);done(); finish_audio(); ui_voice_routed(true, false, "", "h1", "mobile", 1);assert(s.view == AGENT && !s.voice_open && !strcmp(sw.tab, "s1") && !strcmp(sw.lead, "L1"));- // Words for the Swarm chat are always reviewed, a plain tap included, by a daemon that posts a reviewed draft there.+ // Words for the Swarm chat go as any harness's do (Diego's dial, 2026-10-29: "like the other agents"): a tap sends+ // them, and only a held stop reviews them, by a daemon that posts a reviewed draft there.reset(); host_features = 31 | CABLE_FEATURE_SWARM_REVIEW; strcpy(sw.tab, "s1"); strcpy(sw.lead, "L1");dispatch((action_t){.kind = A_VOICE, .id = "h1"}); work(queued); done();+ assert(!reviews && !s.voice_review && s.voice_waiting);+ discard(); finish_audio();+ reset(); host_features = 31 | CABLE_FEATURE_SWARM_REVIEW; strcpy(sw.tab, "s1"); strcpy(sw.lead, "L1");+ dispatch((action_t){.kind = A_VOICE, .id = "h1"}); work(queued); dispatch((action_t){.kind = A_VOICE_STOP, .value = 1});assert(reviews == 1 && s.voice_review && s.voice_waiting);discard(); finish_audio();// On the Buddy side the turn is pinned to it when it starts, with the Buddy's engine; a later side change moves neither.@@ -198,6 +204,21 @@ int main(void) {dispatch((action_t){.kind = A_VOICE, .id = "h1"}); work(queued); dispatch((action_t){.kind = A_VOICE_STOP, .value = 1});assert(!reviews && !s.voice_review && s.voice_waiting);discard(); finish_audio();+ // Diego's dial, 2026-10-29: the openharness Lead ran on another Mac, so the face named no one and a tap did nothing.+ // A Lead on another machine (web, L2) is named by its Swarm id to a daemon that posts in its chat; an older daemon+ // would hand that id to the pane focused in the window, so it is named to none.+ reset(); host_features = 31 | CABLE_FEATURE_SWARM_REVIEW; strcpy(sw.tab, "s1"); strcpy(sw.lead, "L2");+ assert(!swarm_voice_id()[0]);+ host_features |= CABLE_FEATURE_SWARM_REMOTE;+ assert(!strcmp(swarm_voice_id(), "L2"));+ action_t remote = {.kind = A_VOICE}; strcpy(remote.id, swarm_voice_id());+ dispatch(remote); work(queued);+ assert(recording && s.view == VOICE && s.voice_swarm && !strcmp(started_for, "L2"));+ assert(!strcmp(s.voice_engine, "claude") && !strcmp(s.voice_target, "web"));+ done(); assert(!reviews && !s.voice_review && s.voice_waiting);+ discard(); finish_audio();+ // A Lead here is still named by its harness.+ strcpy(sw.lead, "L1"); assert(!strcmp(swarm_voice_id(), "h1"));// A desk pane's id while a Lead is on the face is no Lead's harness: the pane's own engine.strcpy(s.agents[0].engine, "claude"); begin();assert(!strcmp(started_for, "agent") && !strcmp(s.voice_engine, "claude"));@@ -301,6 +322,8 @@ int main(void) {assert(s.voice_retry_until==1); now=1; habitat_tick(); assert(!s.voice_retry_until);begin(); done(); finish_audio(); ui_voice_error("Didn't catch that");ui_set_connected(false); assert(!s.voice_retry_until);+ // The daemon a link drops forgets the Swarm Lead open here: the next one is told again (test_touch_ui.py).+ sw.opened = true; ui_set_connected(false); assert(!sw.opened);reset(); begin(); now = 601000; habitat_tick();assert(stops == 1 && s.voice_waiting);diff --git a/docs/device-voice-swarm-chat.md b/docs/device-voice-swarm-chat.mdindex 8dced24fa..00faca26f 100644--- a/docs/device-voice-swarm-chat.md+++ b/docs/device-voice-swarm-chat.md@@ -7,8 +7,10 @@ shows the words first (device owner's choice 2a, 2026-10-27).## Behaviour-- Tap the Swarm face, speak, tap again. The dial shows the words with the project and chat it will post to- (`openharness · Lead`, `openharness · PM`, a group's title or the Buddy's name), then **Send** or **Discard**.+- Tap the Swarm face, speak, tap again: the words go to that chat as any harness's do (owner, 2026-10-29: "like the+ other agents"; until then every word was reviewed). Hold to finish instead and the dial shows the words with the+ project and chat it will post to (`openharness · Lead`, `openharness · PM`, a group's title or the Buddy's name),+ then **Send** or **Discard**.- Send posts them in that chat as the person, with the same command typing uses and the same access check. Discard postsnothing.- The chat is the one on the face when the person began to speak, even if the desktop moves while they speak or review.@@ -20,12 +22,16 @@ shows the words first (device owner's choice 2a, 2026-10-27).| Direction | Field | Meaning ||---|---|---|| daemon → device | `welcome.features` has `swarm.review` | Words reviewed on a Swarm face are posted in its chat by Send |-| device → daemon | `hello.swarmReview: "v1"` | This dial reviews every word for a Swarm chat |+| daemon → device | `welcome.features` has `swarm.remote` | A Lead on another machine may be named by its Swarm id; its words go to its chat |+| device → daemon | `hello.swarmReview: "v1"` | This dial reviews every word for a Swarm chat (no dial sends it since 2026-10-29) || device → daemon | `voice.end.review: true` | As for any draft; then `voice.draft` with `name` and `context: "Swarm chat"` |- A dial asks for review on a Swarm face only from a daemon that lists `swarm.review`. An older daemon would type thereviewed draft into the Lead's terminal, so with one the face posts at once, as before, and a hold does not offer review.- Words begun on a Swarm face keep the face's Lead as their recipient: a pane focused in the window never takes them.+- Where the Lead runs does not matter (owner, 2026-10-29). A Lead on another machine has no harness here, so the dial names it+ by its Swarm id, and only to a daemon that lists `swarm.remote`: an older one would hand an unknown id to the pane+ focused in the window. Its words go to its chat or nowhere: a post the Swarm cannot take is an error, never a turn.- Send passes `reviewed` with the chat: `SwarmCards.say` posts there while it is still the Lead conversation or an open chatof that Lead's project this reader may see, even if the face moved since. Unreviewed words keep today's rule (refusedonce the face moved).