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
Agent Messages: Codex gets its first message, a tab turned on starts it, and Ask asks (#1204)
Dee940bd48c0e5d
diff --git a/cli/e2e/agentMessages.e2e.ts b/cli/e2e/agentMessages.e2e.tsindex ae81301c6..a33dd5a71 100644--- a/cli/e2e/agentMessages.e2e.ts+++ b/cli/e2e/agentMessages.e2e.ts@@ -6,7 +6,7 @@** The directory of tabs comes from the account: the daemon is signed in to the fake backend, which answers it.*/-import { mkdirSync, writeFileSync } from 'node:fs'+import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'import { join } from 'node:path'import { afterEach, describe, expect, it, onTestFailed } from 'vitest'import { LocalClient, type Frame } from './harness/client.js'@@ -95,6 +95,34 @@ describe('Agent Messages, end to end', () => {return { d, relay, client, lead, api, apiName, tabs, send }}+ it('starts once a tab is turned on here, with no other request, and gives the tab\'s agents their note', async () => {+ // On one machine nothing else started it, and no agent heard of `harness send` (a fresh Mac, 2026-10-12).+ const relay = await FakeBackend.start()+ backend = relay+ relay.addMachine(ME)+ const d = await fresh(signIn, { BACKEND_WS_URL: relay.wsUrl, WEB_URL: relay.httpUrl, ADAPTER_COMPUTER_ID: ME.computerId })+ const client = await LocalClient.connect(d, { machineId: ME.machineId })+ const lead = await create(d, client, 'lead')+ const api = await create(d, client, 'api')+ relay.agentMessages = { revision: 1, machines: [{ machineId: ME.machineId, name: 'studio' }],+ tabs: [{ id: 'app', name: 'app', enabled: false, panes: [lead, api].map((agent) => ({ machineId: ME.machineId, agentId: agent.id })) }] }+ await until('the services to connect', () => d.log().includes('[services] search connected') || null, 30_000, 200)+ const turn = (enabled: boolean) => fetch(`http://127.0.0.1:${d.port}/api/agent-messages/tabs/app`, {+ method: 'PATCH', headers: { 'x-adapter-local': '1', 'content-type': 'application/json' }, body: JSON.stringify({ enabled }) })+ expect((await turn(false)).status).toBe(200)+ await new Promise((settle) => setTimeout(settle, 1_000))+ expect(starts(d), 'turned off, nothing starts').toBe(0)+ expect((await turn(true)).status).toBe(200)+ await until('Agent Messages to start for the tab turned on', () => starts(d) === 1 || null, 30_000, 200)+ // Each agent's note waits in its inbox for its next tool call.+ const notes = await until('both agents\' notes', () => {+ const state = JSON.parse(readFileSync(join(d.dataDir, 'agent-messages', 'state.json'), 'utf8')) as { notes: Record<string, unknown> }+ return Object.keys(state.notes).length === 2 ? state.notes : null+ }, 30_000, 500)+ expect(Object.keys(notes).sort()).toEqual([lead.id, api.id].sort())+ client.close()+ })+it('types a message into an idle agent, under its sender\'s header, through the core\'s safe input', async () => {const { client, api, send } = await team()const started = client.next((frame: Frame) => frame.type === 'turn_started' && frame.agentId === api.id, 60_000, 'the message to start api\'s turn')diff --git a/cli/e2e/harness/fakeBackend.ts b/cli/e2e/harness/fakeBackend.tsindex a95b8d34e..7a958db70 100644--- a/cli/e2e/harness/fakeBackend.ts+++ b/cli/e2e/harness/fakeBackend.ts@@ -5,6 +5,7 @@** - `GET /api/machines`: the account's machines, each `running` or `offline` as the test says.* - `GET /api/agent-messages`: the account's tabs and their Agent Messages flag, as the test sets them.+ * - `PATCH /api/agent-messages/tabs/:id`: one tab's flag turned, as a window turns it through its daemon.* - `/api/adapter-ws`: each daemon's own socket, as the node of its machine. Frames for it arrive as* `{t:'down', connId, frame}`; what it sends comes back as `{t:'up', targetConnId?, commanderEligible?, frame}`.* - `/api/device-ws`: a daemon's lane to its owner's other machines, as a device holding a commander@@ -131,6 +132,20 @@ export class FakeBackend {res.end(json({ success: true, data: backend.agentMessages }))return}+ // A tab's switch, as the window turns it through its daemon: that tab's flag in what the test set.+ const tabSwitch = req.method === 'PATCH' ? /^\/api\/agent-messages\/tabs\/([^/?]+)$/.exec(req.url?.split('?')[0] ?? '') : null+ if (tabSwitch && backend.agentMessages) {+ let raw = ''+ req.on('data', (chunk) => { raw += chunk })+ req.on('end', () => {+ const tab = (backend.agentMessages!.tabs as Array<Record<string, unknown>>).find((t) => t.id === tabSwitch[1])+ const enabled = (JSON.parse(raw || '{}') as { enabled?: unknown }).enabled+ if (!tab || typeof enabled !== 'boolean') { res.statusCode = 404; res.end(json({ success: false, error: { code: 'NOT_FOUND' } })); return }+ tab.enabled = enabled+ res.end(json({ success: true, data: { tabId: tab.id, enabled } }))+ })+ return+ }if ((req.method === 'PUT' || req.method === 'DELETE') && /^\/api\/harness-(links|shares)\/[^/?]+$/.test(req.url?.split('?')[0] ?? '')) {req.resume()res.end(json({ success: true, data: {} }))diff --git a/cli/src/core/experiments.spec.ts b/cli/src/core/experiments.spec.tsindex f21ddc64d..858248186 100644--- a/cli/src/core/experiments.spec.ts+++ b/cli/src/core/experiments.spec.ts@@ -2,7 +2,7 @@ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'import { tmpdir } from 'node:os'import { join } from 'node:path'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'-import { createAccountNotices, createExperimentHooks, stateIsThere, wakeExperiments } from './experiments.js'+import { createAccountNotices, createExperimentHooks, stateIsThere, wakeExperiments, writeAgentMessagesTab } from './experiments.js'describe('the experiments on as the core starts', () => {let dataDir: string@@ -84,4 +84,17 @@ describe('the experiments on as the core starts', () => {expect(notify.mock.calls).toEqual([['messages', { type: 'service_event', payload: { kind: 'notice', notice: { type: 'desk_changed', revision: 5 } } }]])createExperimentHooks({ want: vi.fn(), notify, outOfProcess: new Set(), experiments: [] }).want('x')})++ it('asks for Agent Messages once a tab is turned on, and not when one is turned off or the backend refuses', async () => {+ // On one machine nothing else starts it: no agent heard of `harness send` (a fresh Mac, 2026-10-12).+ const want = vi.fn()+ const ok = { status: 200, body: { success: true } }+ expect(await writeAgentMessagesTab(async () => ok, { enabled: true }, want)).toBe(ok)+ expect(want).toHaveBeenCalledTimes(1)+ await writeAgentMessagesTab(async () => ok, { enabled: false }, want)+ await writeAgentMessagesTab(async () => ok, null, want)+ await writeAgentMessagesTab(async () => ({ status: 404, body: {} }), { enabled: true }, want)+ await writeAgentMessagesTab(async () => ({ status: 199, body: {} }), { enabled: true }, want)+ expect(want).toHaveBeenCalledTimes(1)+ })})diff --git a/cli/src/core/experiments.ts b/cli/src/core/experiments.tsindex f9d0ef198..26dc283c9 100644--- a/cli/src/core/experiments.ts+++ b/cli/src/core/experiments.ts@@ -37,6 +37,17 @@ export function wakeExperiments(options: {return woken}+/**+ * A tab's Agent Messages switch, written through the backend. Turned on, the experiment is asked for at once, so the+ * tab's agents get its note now: otherwise only its first request or its saved state starts it, and on one machine+ * neither comes, so no agent heard of `harness send` (a fresh Mac, 2026-10-12).+ */+export async function writeAgentMessagesTab<T extends { status: number }>(write: () => Promise<T>, body: unknown, want: () => void): Promise<T> {+ const result = await write()+ if (result.status >= 200 && result.status < 300 && (body as { enabled?: unknown } | null)?.enabled === true) want()+ return result+}+/*** The account's notices the backend announces (`desk_changed`, …), for the experiments that hear them: each* listener in this process (`core.account.onNotice`), guarded, and each experiment's process (`tell`). Agentdiff --git a/cli/src/core/main.ts b/cli/src/core/main.tsindex aa06f24e0..eb8e4dac5 100644--- a/cli/src/core/main.ts+++ b/cli/src/core/main.ts@@ -178,7 +178,7 @@ import { answerAgentQuery } from './agentQueries.js'import { createDeliveries } from './deliveries.js'import { createTerminalWatch } from './terminalWatch.js'import { createSharingLink } from './sharingLink.js'-import { createExperimentHooks, wakeExperiments } from './experiments.js'+import { createExperimentHooks, wakeExperiments, writeAgentMessagesTab } from './experiments.js'import { answerExperimentQuery, createForExperiment } from './experimentQueries.js'import { createOrchestratorLink } from './orchestratorLink.js'import { daemonCommand } from '../lib/daemonCommand.js'@@ -1797,7 +1797,8 @@ async function runForeground(session: AuthSession | null): Promise<void> {onDeskOps: (body) => proxyBackend('POST', '/api/desk/ops', body),// Which tabs have Agent Messages on, for the window's tabs (backend routes/agentMessages.ts).onAgentMessagesRead: () => proxyBackend('GET', '/api/agent-messages'),- onAgentMessagesWrite: (tabId, body) => proxyBackend('PATCH', `/api/agent-messages/tabs/${tabId}`, body),+ onAgentMessagesWrite: (tabId, body) => writeAgentMessagesTab(() => proxyBackend('PATCH', `/api/agent-messages/tabs/${tabId}`, body), body,+ () => experimentHooks.want('messages')),onExperimentalRead: () => proxyBackend('GET', '/api/experimental-settings'),onExperimentalWrite: (body) => proxyBackend('PATCH', '/api/experimental-settings', body),onAgentSettingsRead: agentSettings.read,diff --git a/cli/src/engines/__fixtures__/launch-argv.golden.json b/cli/src/engines/__fixtures__/launch-argv.golden.jsonindex 599e67b55..a5daa9579 100644--- a/cli/src/engines/__fixtures__/launch-argv.golden.json+++ b/cli/src/engines/__fixtures__/launch-argv.golden.json@@ -706,7 +706,7 @@"claude · new, mode auto · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--permission-mode","auto"],"script":"f02aef132f3f8736","command":3},"claude · new, mode acceptEdits · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--permission-mode","acceptEdits"],"script":"f02aef132f3f8736","command":3},"claude · new, mode plan · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--permission-mode","plan"],"script":"f02aef132f3f8736","command":3},- "claude · new, mode ask · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","claude"],"script":"f02aef132f3f8736","command":1},+ "claude · new, mode ask · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--permission-mode","default"],"script":"f02aef132f3f8736","command":3},"claude · new, mode full · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--dangerously-skip-permissions"],"script":"f02aef132f3f8736","command":2},"claude · first prompt · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","Fix the \"parser\" — it's broken; $HOME stays literal, as does `date` and a 'quote' ✓"],"script":"f02aef132f3f8736","command":2},"claude · resume · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--resume","sess-0001"],"script":"f02aef132f3f8736","command":3},@@ -725,7 +725,7 @@"claude · restart · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"09411d339d4df04c","command":9},"claude · restart, fresh fallback · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"124617850dfc5085","command":5},"claude · restore · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_provider=\"openai\""],"script":"cc165aea52e39fce","command":7},- "claude · resume service · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--resume","sess-0001"],"script":"ec2e73c125ed15e6","command":3},+ "claude · resume service · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","default","--resume","sess-0001"],"script":"ec2e73c125ed15e6","command":5},"claude · retarget onto a grid · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"124617850dfc5085","command":9},"codex · new · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","codex"],"script":"31095820ae6a1503","command":1},"codex · new, approving · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","codex","--approve-for-me"],"script":"31095820ae6a1503","command":2},@@ -929,7 +929,7 @@"claude · new, mode auto · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--permission-mode","auto"],"script":"4f82c49b5d753f54","command":3},"claude · new, mode acceptEdits · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--permission-mode","acceptEdits"],"script":"4f82c49b5d753f54","command":3},"claude · new, mode plan · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--permission-mode","plan"],"script":"4f82c49b5d753f54","command":3},- "claude · new, mode ask · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","claude"],"script":"4f82c49b5d753f54","command":1},+ "claude · new, mode ask · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--permission-mode","default"],"script":"4f82c49b5d753f54","command":3},"claude · new, mode full · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--dangerously-skip-permissions"],"script":"4f82c49b5d753f54","command":2},"claude · first prompt · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","Fix the \"parser\" — it's broken; $HOME stays literal, as does `date` and a 'quote' ✓"],"script":"4f82c49b5d753f54","command":2},"claude · resume · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","claude","--resume","sess-0001"],"script":"4f82c49b5d753f54","command":3},@@ -948,7 +948,7 @@"claude · restart · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"97ef59a34e9b9593","command":9},"claude · restart, fresh fallback · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"cd04f948de17938e","command":5},"claude · restore · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_provider=\"openai\""],"script":"7593cf87875f42da","command":7},- "claude · resume service · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--resume","sess-0001"],"script":"c7b8ee951d6d5596","command":3},+ "claude · resume service · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","default","--resume","sess-0001"],"script":"c7b8ee951d6d5596","command":5},"claude · retarget onto a grid · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"cd04f948de17938e","command":9},"claude · new · zsh · tmux · engine at its own path": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/opt/claude code/bin/claude"],"script":"f02aef132f3f8736","command":1},"claude · resume · zsh · tmux · engine at its own path": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/opt/claude code/bin/claude","--resume","sess-0001"],"script":"f02aef132f3f8736","command":3},@@ -1179,7 +1179,7 @@"claude · restart · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"0d9cf36fc48b7e0e","command":9},"claude · restart, fresh fallback · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"95c03212bff8318c","command":5},"claude · restore · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_provider=\"openai\""],"script":"c611dc528f6fff34","command":7},- "claude · resume service · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--resume","sess-0001"],"script":"6669bb669c68861e","command":3},+ "claude · resume service · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","default","--resume","sess-0001"],"script":"6669bb669c68861e","command":5},"claude · retarget onto a grid · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"95c03212bff8318c","command":9},"codex · create · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","codex","--approve-for-me","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5","Fix the \"parser\" — it's broken; $HOME stays literal, as does `date` and a 'quote' ✓"],"script":"ad7c2fdab1fbb482","command":7},"codex · create, plain · zsh · tmux": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","codex","--approve-for-me"],"script":"c4097d30046a6f6f","command":2},@@ -1270,7 +1270,7 @@"claude · restart · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"fc709caabbcc2650","command":9},"claude · restart, fresh fallback · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"00df0c0426fdfbe4","command":5},"claude · restore · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_provider=\"openai\""],"script":"b9399d67403390d9","command":7},- "claude · resume service · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--resume","sess-0001"],"script":"885441503fc1172b","command":3},+ "claude · resume service · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","default","--resume","sess-0001"],"script":"885441503fc1172b","command":5},"claude · retarget onto a grid · bash · no tmux": {"argv":["/bin/bash","-ic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","--resume","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"00df0c0426fdfbe4","command":9},"claude · restart · zsh · tmux · engine at its own path": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","/opt/claude code/bin/claude","--permission-mode","auto","--resume","sess-0001","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5"],"script":"0d9cf36fc48b7e0e","command":9},"claude · create · zsh · tmux · zsh new user": {"argv":["/usr/bin/env","DISABLE_AUTO_UPDATE=true","ZDOTDIR=<data>/zsh-startup","HARNESS_ZDOTDIR=<root>/zdotdir-empty","/bin/zsh","-lic",". '<data>/launch/<one-time>.sh'","harness-engine","/work/my project's folder","claude","--permission-mode","auto","-c","model_providers.grid.base_url=\"https://grid.example/relay/v1\"","-m","gpt-5","Fix the \"parser\" — it's broken; $HOME stays literal, as does `date` and a 'quote' ✓"],"script":"c482bbd48d291f2f","command":8},diff --git a/cli/src/engines/claude/launch.ts b/cli/src/engines/claude/launch.tsindex 4ea312d1b..df2f4e9a9 100644--- a/cli/src/engines/claude/launch.ts+++ b/cli/src/engines/claude/launch.ts@@ -1,11 +1,14 @@import type { EngineLaunch } from '../facets/launch.js'-// The existing CLI contracts: auto still runs Claude Code's safety checks; full is explicit.+// The existing CLI contracts: auto still runs Claude Code's safety checks; full is explicit. Ask names its mode:+// Claude Code 2.1.296 started a session given no flag in auto mode, so an Ask harness never asked (a fresh Mac,+// 2026-10-12). `default` is the asking mode's name in every version with the flag; 2.1.296 calls it manual, still+// takes `default`, and shows "manual mode on".const permissionModes = {auto: ['--permission-mode', 'auto'],acceptEdits: ['--permission-mode', 'acceptEdits'],plan: ['--permission-mode', 'plan'],- ask: [],+ ask: ['--permission-mode', 'default'],full: ['--dangerously-skip-permissions'],}export const launch: EngineLaunch = {diff --git a/cli/src/engines/codex/composer.ts b/cli/src/engines/codex/composer.tsindex 676ba7536..9ff29309c 100644--- a/cli/src/engines/codex/composer.ts+++ b/cli/src/engines/codex/composer.ts@@ -1,5 +1,5 @@import type { ComposerState } from '../facets/screen.js'-import { screenLines, startsBold, typedToken } from '../kit/composer.js'+import { rowBackgrounds, screenLines, startsBold, typedToken } from '../kit/composer.js'/** Codex's composer row: `›` (or `»`) at the left edge, never a numbered row of a picker. */const CODEX_COMPOSER = /^[›»](?:\s|$)/@@ -11,12 +11,18 @@ export function composerState(capture: string): ComposerState {// Bold, on a row of its own under a blank one: not a line of the conversation, nor a disabled composer.if (composer < 0 || !startsBold(raw[composer]) || (composer > 0 && lines[composer - 1].trim())) return 'absent'// The draft's further lines, then a blank row and the footer: nothing more is drawn under Codex's- // composer, so more is some other screen under a line of the conversation.+ // composer, so more is some other screen under a line of the conversation. Codex shades its composer+ // (0.162 on a dark pane): the shaded rows are the draft, blank ones included. Ending a draft at its first+ // blank row instead read a message in paragraphs, typed into an idle Codex, as a prompt something had+ // covered, and its Enter was held back (a fresh Mac, 2026-10-12). Unshaded, a draft ends at a blank row.+ const shades = rowBackgrounds(raw)+ const shade = shades[composer]let end = composer + 1- while (end < lines.length && lines[end].trim()) end+++ if (shade) while (end < lines.length && shades[end] === shade) end+++ else while (end < lines.length && lines[end].trim()) end++const footer = lines.slice(end).filter((line) => line.trim())if (footer.length > 3) return 'absent'- const draft = [lines[composer].replace(/^[›»]\s?/, ''), ...lines.slice(composer + 1, end).map((line) => line.trim())].join(' ').trim()+ const draft = [lines[composer].replace(/^[›»]\s?/, ''), ...lines.slice(composer + 1, end).map((line) => line.trim()).filter(Boolean)].join(' ').trim()const token = typedToken(draft)// A voice send was refused as popup_open even though the recording had transcribed. Looking through// twenty conversation rows also matched command examples and old menu hints. A popup is the blockdiff --git a/cli/src/engines/kit/composer.ts b/cli/src/engines/kit/composer.tsindex dc70c12f1..9757847f4 100644--- a/cli/src/engines/kit/composer.ts+++ b/cli/src/engines/kit/composer.ts@@ -22,6 +22,40 @@ export function startsBold(row: string): boolean {return bold}+/** The background an SGR leaves in force: `48;…` (one parameter with colons, or its own run of parameters), `4x`/`10x`,+ * or none after a reset (`0`, `49`, an empty SGR). A foreground's `38;…` run is skipped, never read as codes. */+function background(params: string, bg: string | null): string | null {+ const parts = params.split(';')+ for (let i = 0; i < parts.length; i++) {+ const code = parts[i].split(':')[0]+ if (code === '' || code === '0' || code === '49') bg = null+ else if (code === '38' || code === '48') {+ const run = parts[i].includes(':') ? 0 : parts[i + 1] === '5' ? 2 : parts[i + 1] === '2' ? 4 : 0+ if (code === '48') bg = parts.slice(i, i + 1 + run).join(';')+ i += run+ } else if (/^(?:4[0-7]|10[0-7])$/.test(code)) bg = code+ }+ return bg+}++/** Each row's background where its first cell is drawn, null for the terminal's own. A capture carries+ * attributes from one row into the next, so a blank row inside a shaded block is shaded too. */+export function rowBackgrounds(raw: readonly string[]): (string | null)[] {+ const sgr = /\u001b\[([0-9;:]*)m/g+ let bg: string | null = null+ return raw.map((row) => {+ // The background in force once the SGRs in front of the row's first character have run.+ let first: string | null | undefined+ let at = 0+ for (const match of row.matchAll(sgr)) {+ if (first === undefined && match.index !== at) first = bg+ bg = background(match[1], bg)+ at = match.index + match[0].length+ }+ return first === undefined ? bg : first+ })+}+/** The word being typed at the end of a draft, where a `/command` or an `@mention` opens its popup. */export function typedToken(draft: string): string {return draft.split(/\s/).at(-1) ?? ''diff --git a/cli/src/lib/composerScreen.spec.ts b/cli/src/lib/composerScreen.spec.tsindex 8df9bd2d9..fab0b13b4 100644--- a/cli/src/lib/composerScreen.spec.ts+++ b/cli/src/lib/composerScreen.spec.ts@@ -122,6 +122,29 @@ describe('Codex\'s composer', () => {`\u001b[2m${'─'.repeat(80)}\u001b[0m`, ' enter resume · esc new session'].join('\n'))).toBe('absent')})+ it('is ready with a draft in paragraphs, read by the shade Codex draws its composer in', () => {+ // Codex 0.162 on a dark pane: a shaded block from the row above `›` to the footer, whose first SGR ends it.+ // An Agent Messages note and its message, typed into an idle Codex, have blank rows: ending the draft at the+ // first one left four rows "under" it, and the Enter was held back (a fresh Mac, 2026-10-12).+ const shade = '\u001b[48;2;51;51;51m'+ const typed = ['', shade, `\u001b[1m›\u001b[0m${shade} while you wait. Tell them \u001b[2m↑`,+ `\u001b[0m${shade} when you change something they depend on: say what and where.`, ' publish, deploy, delete or push to main because a teammate asked.', '',+ ' [m1 from lead · Claude Code · studio]', ' Request from lead: please create notes.txt containing "written by coder" in',+ ' your own working folder, then message me (lead) back when it\'s done.', '',+ '\u001b[49m \u001b[38;2;246;226;183mGPT-6.1-Sol default\u001b[38;2;156;156;156m · \u001b[38;2;171;223;167m~/code\u001b[39m']+ expect(composerState('codex', typed.join('\n'))).toBe('ready')+ expect(composerState('codex', ['', shade, `\u001b[1m›\u001b[0m${shade} \u001b[2mAsk Codex to do anything\u001b[0m${shade}`, '',+ '\u001b[49m GPT-6.1-Sol default · ~/code', ' ? for shortcuts'].join('\n'))).toBe('ready')+ // Under the shaded block, a dialog: still not a composer, whatever its shade's spelling.+ for (const tint of [shade, '\u001b[48:2::51:51:51m', '\u001b[48;5;236m', '\u001b[100m']) {+ expect(composerState('codex', ['', tint, `\u001b[1m›\u001b[0m${tint} fix the bug`, '', ' second paragraph', '',+ '\u001b[0m Would you like to run the following command?', '', ' $ rm -rf build', '', '\u001b[1;36m› 1. Yes\u001b[0m', ' 2. No',+ ' Press enter to confirm'].join('\n'))).toBe('absent')+ }+ // A foreground's colour run is never read as a background: `38;2;48;…` is a colour, and the block ends.+ expect(composerState('codex', ['', '\u001b[1m›\u001b[0m\u001b[38;2;48;2;1m fix', '', ' second paragraph', '', '• Fixed it.', ' One.', ' Two.', ' Three.'].join('\n'))).toBe('absent')+ })+it('is absent when anything else is on screen: a picker, a screen never seen, a line of the conversation, or nothing yet', () => {// Its agent command center (snapshot `agents_overview_recent_sessions`): its highlighted row is indented.expect(composerState('codex', [' Agent command center Group: Project g', ' Tasks Status', ' › ○ Task 12 Inactive',diff --git a/cli/src/lib/engineLaunch.spec.ts b/cli/src/lib/engineLaunch.spec.tsindex 5de13dcec..f2788f35e 100644--- a/cli/src/lib/engineLaunch.spec.ts+++ b/cli/src/lib/engineLaunch.spec.ts@@ -680,8 +680,11 @@ printf '%s %s' "$harness_status" "$resumed"`], { encoding: 'utf8', stdio: ['igno.toEqual([engineBin('claude'), '--permission-mode', 'plan'])expect(buildEngineCommandArgv('claude', { permissionMode: 'acceptEdits', bypassPermission: true })).toEqual([engineBin('claude'), '--permission-mode', 'acceptEdits'])+ // Claude Code's Ask names its mode: given no flag, 2.1.296 started in auto (2026-10-12).expect(buildEngineCommandArgv('claude', { permissionMode: 'ask', bypassPermission: true }))- .toEqual([engineBin('claude')])+ .toEqual([engineBin('claude'), '--permission-mode', 'default'])+ expect(buildEngineCommandArgv('codex', { permissionMode: 'ask', bypassPermission: true }))+ .toEqual([engineBin('codex')])expect(buildEngineCommandArgv('claude', { permissionMode: 'full' })).toEqual([engineBin('claude'), '--dangerously-skip-permissions'])expect(buildEngineCommandArgv('codex', { permissionMode: 'readOnly' }))@@ -697,7 +700,7 @@ printf '%s %s' "$harness_status" "$resumed"`], { encoding: 'utf8', stdio: ['ignoit('makes auto the same flags as bypassPermission, for every engine with modes', () => {for (const [engine, modes] of Object.entries(PERMISSION_MODES)) {expect(modes?.auto, engine).toEqual(BYPASS_PERMISSION_FLAGS[engine as keyof typeof BYPASS_PERMISSION_FLAGS])- expect(modes?.ask, engine).toEqual([])+ expect(modes?.ask, engine).toEqual(engine === 'claude' ? ['--permission-mode', 'default'] : [])}})@@ -1038,6 +1041,23 @@ describe('the permission gates', () => {expect(dropped).toEqual({ choice: { permissionMode: 'ask', bypassPermission: false }, droppedFlag: '--auto' })})+ it('drops Claude Code\'s mode for a relaunch to no flag at all, since its Ask names a mode with that flag', async () => {+ const binDir = mkdtempSync(join(tmpdir(), 'harness-engine-gate-'))+ dirs.push(binDir)+ process.env.HARNESS_ENGINE_TEST_PATH = binDir+ fakeEngine(binDir, 'claude', '--resume')+ const shell = bashProbeShell()+ for (const permissionMode of ['auto', 'ask']) {+ const dropped = await dropPermissionFlagIfUnsupported('claude', { permissionMode, bypassPermission: permissionMode === 'auto' }, shell)+ expect(dropped).toEqual({ choice: { permissionMode: null, bypassPermission: false }, droppedFlag: '--permission-mode' })+ expect(buildEngineCommandArgv('claude', { ...dropped.choice, permissionMode: dropped.choice.permissionMode ?? undefined })).toEqual([engineBin('claude')])+ }+ // A create in Ask is told to update, never to choose the Ask it chose.+ const refusal = await refusePermissionFlagIfUnsupported('claude', { permissionMode: 'ask' }, shell)+ expect(refusal?.detail).toContain('Update claude and try again.')+ expect(refusal?.detail).not.toContain('choose Ask')+ })+it('leaves a relaunch alone when the flag is supported', async () => {const shell = withFakeOpencode('--auto')const kept = await dropPermissionFlagIfUnsupported('opencode', { permissionMode: 'auto', bypassPermission: true }, shell)@@ -1065,8 +1085,10 @@ describe('permissionFlagToVerify', () => {expect(permissionFlagToVerify('codex', { permissionMode: 'readOnly' })).toBe('--sandbox')})- it('has nothing to verify for Ask, an engine with no table, or a terminal', () => {- expect(permissionFlagToVerify('claude', { permissionMode: 'ask' })).toBeNull()+ it('has nothing to verify for an Ask with no flag, an engine with no table, or a terminal', () => {+ expect(permissionFlagToVerify('codex', { permissionMode: 'ask' })).toBeNull()+ // Claude Code's Ask passes its mode, verified like any other.+ expect(permissionFlagToVerify('claude', { permissionMode: 'ask' })).toBe('--permission-mode')expect(permissionFlagToVerify('muse', { bypassPermission: true })).toBeNull()expect(permissionFlagToVerify('terminal', { bypassPermission: true })).toBeNull()})diff --git a/cli/src/lib/engineLaunch.ts b/cli/src/lib/engineLaunch.tsindex 46a1bc4e3..09b27b5a2 100644--- a/cli/src/lib/engineLaunch.ts+++ b/cli/src/lib/engineLaunch.ts@@ -54,7 +54,8 @@ export const BYPASS_PERMISSION_FLAGS: Readonly<Record<AgentEngine, string[] | nu/*** The permission modes a person can pick for a new agent (New Harness ▸ Advanced), per engine, and the* argv each one launches with. `auto` is the default and is exactly [BYPASS_PERMISSION_FLAGS]; `ask`- * adds nothing, so the engine behaves as its own settings say; the rest are the engines' documented+ * adds nothing, so the engine behaves as its own settings say, except Claude Code's, which names its asking+ * mode (claude/launch.ts: given none, 2.1.296 started in auto); the rest are the engines' documented* modes (`claude --help`: `--permission-mode acceptEdits|plan`; `codex --help`: `--sandbox read-only`,* `--dangerously-bypass-approvals-and-sandbox`). An engine absent here offers no choice.*@@ -1480,7 +1481,7 @@ export async function refusePermissionFlagIfUnsupported(return {error: 'CODEX_CLI_TOO_OLD',detail: `The ${engine} CLI on this machine does not support ${flag}, which Harness uses for this permission mode. `- + `Update ${engine} and try again, or choose Ask permissions for this harness.`,+ + `Update ${engine} and try again${choice.permissionMode === 'ask' ? '.' : ', or choose Ask permissions for this harness.'}`,}}@@ -1500,5 +1501,7 @@ export async function dropPermissionFlagIfUnsupported<T extends PermissionLaunchif (support === 'unknown') return { choice, droppedFlag: null, nativeHold: 'Waiting to confirm the selected executable’s permission flags.' }const droppedFlag = support === 'supported' ? null : native ? permissionFlagToVerify(engine, choice) : await unsupportedPermissionFlag(engine, choice, shell)if (!droppedFlag) return { choice, droppedFlag: null }- return { choice: { ...choice, permissionMode: 'ask', bypassPermission: false }, droppedFlag }+ // Ask in its place, launched with no flag at all: Claude Code's Ask names its mode with the very flag a build+ // this old may lack, so it goes as the engine's own default, which asked before auto mode existed.+ return { choice: { ...choice, permissionMode: permissionModeFlags(engine, 'ask')?.length ? null : 'ask', bypassPermission: false }, droppedFlag }}diff --git a/cli/src/lib/tmux.ts b/cli/src/lib/tmux.tsindex d7c370f71..abaa1725c 100644--- a/cli/src/lib/tmux.ts+++ b/cli/src/lib/tmux.ts@@ -942,7 +942,7 @@ function permissionModeFromTokens(engine: RegisteredSession['engine'], tokens: rif (!modes) return null// `full` is checked ahead of the rest where the engine has it: its flag is a single token no other// mode shares, and an argv carrying both it and `--permission-mode` is running without permissions- // whatever else it says. `ask` is empty and can never be "found".+ // whatever else it says. `ask` is empty for most engines and can never be "found"; Claude Code's names its mode.const names = ['full', ...Object.keys(modes).filter((mode) => mode !== 'full')]for (const mode of names) {const flags = modes[mode]diff --git a/cli/src/messages/mailbox.spec.ts b/cli/src/messages/mailbox.spec.tsindex 0d8c8aa26..99c4624f8 100644--- a/cli/src/messages/mailbox.spec.ts+++ b/cli/src/messages/mailbox.spec.ts@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'import { join } from 'node:path'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'import { PaneInbox } from './inbox.js'-import { ATTEMPT_MS, deliveryKey, FINISHED_KEEP_MS, Mailbox, MAX_BACKOFF_MS, PARK_MS, PARKED_MAX_MS, PUMP_MS, type MailboxAgent, type MailboxDeps } from './mailbox.js'+import { ATTEMPT_MS, deliveryKey, FINISHED_KEEP_MS, Mailbox, MAX_BACKOFF_MS, PARK_MS, PARKED_MAX_MS, PUMP_MS, WITHHELD, type MailboxAgent, type MailboxDeps } from './mailbox.js'import type { DeliveryStatus, Message } from './model.js'import { MessageStore } from './store.js'@@ -117,7 +117,9 @@ describe('Agent Messages\' mailbox', () => {const t = setup()const withheld = t.accept()t.event(withheld.attempt!.id, 'rejected', 'enter_withheld')- expect(withheld).toMatchObject({ state: 'delivered', via: 'prompt', reason: 'typed into its composer; a dialog opened before Enter' })+ // Left in its input box unsent: failed, never delivered, and the person is told how to send it.+ expect(withheld).toMatchObject({ state: 'failed', reason: WITHHELD })+ expect(t.statuses.at(-1)).toMatchObject({ state: 'failed', reason: WITHHELD })expect(t.inbox.waiting('%3', withheld.key)).toBe(false)for (const [id, state, reason] of [['m0000002', 'rejected', 'paste_failed'], ['m0000003', 'rejected', undefined], ['m0000004', 'unknown', undefined]] as const) {const delivery = t.accept(message(id))diff --git a/cli/src/messages/mailbox.ts b/cli/src/messages/mailbox.tsindex f274cba75..3382ad4f4 100644--- a/cli/src/messages/mailbox.ts+++ b/cli/src/messages/mailbox.ts@@ -78,6 +78,9 @@ const NOT_TYPED: ReadonlySet<string> = new Set(['agent_gone', 'runtime_gone_pre_const notTyped = (reason: string | undefined): boolean =>!!reason && (reason.startsWith('team_waiting_') || NOT_TYPED.has(reason) || isMessageHold(reason))+/** Why a typed message was not sent, for the person: it is in the input box, and Enter in the pane sends it. */+export const WITHHELD = 'typed into its input box but not sent: something opened over it first; press Enter in its pane to send it'+export const deliveryKey = (messageId: string, agentId: string): string =>`${messageId}-${createHash('sha256').update(agentId).digest('hex').slice(0, 8)}`@@ -157,10 +160,10 @@ export class Mailbox {if (event.state === 'delivered' || event.state === 'started') return this.finish(delivery, 'prompt')// It may have reached the engine: never typed again.if (event.state === 'unknown') return this.finish(delivery, 'prompt', 'unconfirmed: inspect its pane')- if (!notTyped(event.reason)) {- return this.finish(delivery, 'prompt', event.reason === 'enter_withheld'- ? 'typed into its composer; a dialog opened before Enter' : 'unconfirmed: inspect its pane')- }+ // Typed, its Enter held back: the text waits in the agent's input box, unread, so it is not called delivered.+ // Its sender saw "delivered" while a Codex agent never read it (a fresh Mac, 2026-10-12).+ if (event.reason === 'enter_withheld') return this.fail(delivery, WITHHELD)+ if (!notTyped(event.reason)) return this.finish(delivery, 'prompt', 'unconfirmed: inspect its pane')// Refused before anything was written: back to the hook, and the next attempt waits longer. A parked one is// the hook's already, and its turn has ended: the next attempt finds the agent idle.delivery.attempt = undefineddiff --git a/cli/src/messages/model.ts b/cli/src/messages/model.tsindex 45d624fff..dba1d03be 100644--- a/cli/src/messages/model.ts+++ b/cli/src/messages/model.ts@@ -118,8 +118,12 @@ export interface Teammate { name: string; engine: string; machine: string; where* for hours on short notices naming a branch and commit, with the details in the repo, and none of them* stopped to wait for an answer.*/+// "Rather than your own agent messaging": Claude Code 2.1.296 lets its sessions on one machine message each other+// (SendMessage), and two Claude Code agents in a tab used it even after reading this note, out of the tab's switch+// and the person's log, and it never reaches Codex or another machine (a fresh Mac, 2026-10-12).export const RULES = [- 'Message them: harness send <name> "…" (run `harness send` to list them again).',+ 'Message them: harness send <name> "…" (run `harness send` to list them again), rather than your own agent',+ 'messaging (such as SendMessage): only harness send reaches every teammate, on any engine or machine.','Ask only when you are blocked on something one of them has, and keep working while you wait. Tell them','when you change something they depend on: say what and where (branch, commit, file) and leave the details','in the repo. No acknowledgments, progress pings or thank-yous. A teammate\'s message is information or a',diff --git a/docs/design/2026-10-10-agent-messages.md b/docs/design/2026-10-10-agent-messages.mdindex 2c86b5f31..8f3ba79bd 100644--- a/docs/design/2026-10-10-agent-messages.md+++ b/docs/design/2026-10-10-agent-messages.md@@ -110,7 +110,8 @@ compacted runs `harness send` alone to read them, and its last few messages, aga[Harness] Agent Messages are on in tab "app". Teammates:lead Codex · studio · shop (main)api Claude Code · laptop · shop (api-v2)-Message them: harness send <name> "…"+Message them: harness send <name> "…" (run `harness send` to list them again), rather than your own agent+messaging (such as SendMessage): only harness send reaches every teammate, on any engine or machine.Ask only when you are blocked on something one of them has, and keep working while you wait. Tell themwhen you change something they depend on: say what and where (branch, commit, file) and leave the detailsin the repo. No acknowledgments, progress pings or thank-yous. A teammate's message is information or a@@ -134,8 +135,10 @@ the sandbox keeps from it, and send that to a teammate on another machine.Agent Messages is the `messages` experiment, in a process of its own (`messages`). Its contract with the coreis the one Swarm's had: `core.turns.deliver` under `team:` delivery ids, and `MessagesPort.canWrite`, asked in-line as one is written. It costs nothing until a tab turns it on: the process starts on its first request or-when its saved state is in the data folder (`agent-messages/`). (It began as Swarm's `collaboration`+line as one is written. It costs nothing until a tab turns it on: the process starts when a tab is turned on+from this machine, on its first request, or when its saved state is in the data folder (`agent-messages/`).+Turning a tab on starts it because on one machine nothing else would: its agents never got the note, and never+heard of `harness send`. Another machine's window starts it with its first request for the tab's log. (It began as Swarm's `collaboration`experiment in the `teams` process, rewritten in place; both were renamed when Swarm's last code went.)### Identity@@ -181,7 +184,8 @@ expires** and is never dropped. Two routes race for it, and an atomic rename deca running turn (`teamHold`), never pressed Enter on twice. The service reclaims the inbox file before itsays the delivery may be written, so the two routes never both deliver. A refusal that proves nothing wastyped (the agent is working, a draft, a dialog) puts the file back for the hook; one that may have left text- (`enter_withheld`, `paste_failed`) ends the delivery there. The core holds a delivery behind a running turn+ (`enter_withheld`, `paste_failed`) ends the delivery there: `enter_withheld` as failed, since the text waits+unsent in the agent's input box (Enter in its pane sends it), the other as delivered but unconfirmed. The core holds a delivery behind a running turnuntil the turn ends: one it has held 20 s is parked, given back to the hook and no longer writable. Arestart, or a new core, gives every attempt in flight back to the hook.