Mesh, nodes and devices
Pair several machines into one theuth, run work on whichever one fits, and follow every session from your phone — plus the lighter "node over SSH" path and how the link relay fits in.
A mesh is two or more running t engines that share one state: sessions, tasks, agents, routines, skills, MCP servers, secrets and documents replicate between them, and one of them — the hub — does the duties that must happen exactly once. You use it when theuth should keep working on a server after you close the laptop, when a build or a GPU lives on another box, or when you want the phone to see every machine behind one name. This page also covers the lighter alternative (a node over SSH, nothing synced) and devices (phone, browser, desktop app) that reach any of it through the link relay.
Prerequisites
- theuth installed on every machine (
ton PATH; see Installation). The desktop app's built-in daemon counts as an engine. - A daemon that stays up where you want work to run:
t --headless, ort --install-serviceto install a user service runningt --headlessthrough your login shell — a launchd LaunchAgent on macOS, asystemd --userunit on Linux. On Windows the command writes a Task Scheduler logon task, but that path is not verified as of this writing; on other systems (Noneunit format) it prints the exec line for you to install yourself. - For phones and browsers:
link.enabled: true(defaultfalse) and a reachablelink.relay(defaultwss://relay.theuth.io, or your own — see Self-hosting the relay). - For the model to message or run anything on another machine from chat: agent messaging. With
agent.communicationunset it is on as soon as this machine has a paired machine; an explicittrueorfalsealways wins. Without itspawn_subagentis not offered at all — see Delegation. - Mesh traffic goes over iroh QUIC, through
mesh.relay(https://iroh.relay.theuth.ioby default) when the two machines cannot reach each other directly. Nothing has to be port-forwarded.
Terminology
The UI and the code use slightly different words; here is the mapping.
| Word | Means |
|---|---|
| engine | One running t. The desktop UI says machine wherever the record says engine: Settings › Network lists "This machine" and "Machines in this mesh". |
| mesh | The paired set of engines, with a name (the first node's name until you set one) and a hub lease. |
| hub | The engine that currently holds the lease: it fires routines without an engine: line, refreshes OAuth tokens, runs the Slack, Signal and Telegram channels, serves paired devices and hosts the live document server. Agent desks are not a hub duty: every engine runs its own, for the tasks homed on it (Tasks › Machines). |
| node over SSH | A machine added with a 3-part link key (/nodes add <key>), reached over the link relay. It runs sessions for you but keeps its own ~/.theuth; nothing is synced. |
| device | A phone, browser or desktop app paired through the link relay. |
| harness | In agent: strings, the external coding harness a child runs in — native, omp, opencode or claude — not a machine. omp@build-box means "omp on the node build-box". |
How it works
Three ways to add a machine
A. Pair it into the mesh. On either side run t mesh pair (or Settings › Network › Advanced › Show pairing string). Paste the string on the other side with t mesh add <string> or the paste-a-pairing-string box under Advanced. Pairing is mutual and transitive: the joiner learns every node the inviter knows. The string carries the inviter's vault data key, so replicated secrets open on both machines. The token inside expires after 5 minutes. From then on the two engines replicate state and either one can run sessions, tasks and routines.
t mesh add --ssh TARGET, t mesh add --docker and t mesh add --vm make a new engine for you (over SSH, in a container, or as a sandbox VM) and pair it in one step; see Sandboxes.
B. Add it as a node over SSH. On the remote box, install theuth, give it a model key and install the service:
brew install basedatum/tap/theuth
t --secret-set anthropic
t --install-service --relay wss://relay.example.comThe last command writes link.enabled: true, starts t --headless as a service, waits up to 15 s for it, prints service installed: <scope> · relay <host> · name <name> and then a QR plus a 3-part key. On your main machine: /nodes add <key> in the terminal UI, or paste the key into Settings › Network under On another computer over SSH, or scan the QR with the phone and choose as a node of …. The node appears in the engine switcher nested under its parent (build-box · via <parent>) and your paired devices are added to it automatically.
A node over SSH is reachable over the link relay only; its sessions, tasks, routines, skills and secrets stay on that box. If you want them shared, pair it into the mesh (path A) instead or in addition.
The README and the t --install-service output still mention "Settings › Nodes › Add node". There is no Nodes tab: the paste field lives in Settings › Network, and devices live in Settings › Link.
C. Nearby and code pairing. Open Settings › Network on both machines. The Nearby section lists unpaired machines on the same LAN (newest first, at most 32; "Only shown while this page is open."). Press Pair… next to one. Both machines show the same 6-digit code (482 913), "Check that <machine> shows the same code" and the warning "Pairing shares your secrets vault, sessions and tasks — only pair your own machines." The request opens the same dialog on the other machine's Network page, with the requester's OS, address and 8-character id. Cancel has the focus; press Pair on both. Nothing is stored and no key moves until both have pressed it; then the normal pairing (path A) runs. The code is commit-reveal: neither side can pick its random part after seeing the other's, so a machine in the middle cannot make both screens show one code.
Nearby runs only while Settings › Network is open, or for mesh.pair_window_secs (120 s) after t mesh pair or after a pairing string is shown, and only while Let nearby machines find this one while pairing (mesh.nearby, default on) is on. An open page holds a 30 s lease it renews every 10 s, so a closed or killed window stops advertising and accepting within 30 s. It advertises mDNS _theuth-mesh._udp with the machine's id, name and OS and only private, link-local or loopback addresses. macOS asks for Local Network permission the first time. Cancel on either side, or the window ending, aborts with "Not paired: <m> pressed Cancel, or the codes did not match." or "The pairing window closed before both machines pressed Pair. Start again from Nearby."
Limits per window: one ceremony per machine and four at once ("too many pairings at once"); three failed ceremonies refuse that machine ("too many failed pairings from this machine"); ten failures from anyone close the window — close and reopen Settings › Network.
Every machine needs this build. A machine on an older theuth cannot read secrets after a vault-key rotation until it upgrades; it is named "runs an older theuth" in the rotation progress and the Unpair dialog.
Unpair, vault-key rotation and device reset
Settings › Network › Machines in this mesh › ⋯ › Unpair… (or t mesh remove <id>) opens "Unpair <machine>?". The machines that stay get a new vault key and re-encrypt every secret with it; the removed machine keeps every secret it already had. The dialog lists "Replace these at their providers if <machine> is lost" (the secret names it had), "Sign in again: …" (OAuth sign-ins), and lines for offline machines (they get the new key when they reconnect), machines on an older theuth (cannot read secrets until they upgrade) and paired phones and iPads. With contacts, it adds "Your contacts are told this machine left. A contact that is offline learns it when it comes back." and what to ask them if the machine was lost or stolen (Contacts). Unpair and rotate key is enabled once that list has loaded. Progress shows in the dialog and as a banner on Settings › Network ("Rotating vault key · 34 of 40 secrets re-encrypted · …", "New vault key in use · …", "Vault key rotated (started 14:02) · old key destroyed"). See Secrets › Rotation.
The checkbox Also reset phone and iPad pairing (off by default) writes a new mesh/device_key after the new vault key (it replicates to the remaining machines only) and revokes every linked phone and iPad on every remaining machine that sees the new key; each must scan the pairing QR again (Settings › Link). The reset is recorded with the new key, so an engine that stops in between finishes it when it starts again.
The new key goes to the remaining machines first: re-encrypting waits until one of them confirms it holds the key, or 10 s pass, so no secret is ever readable on one machine only while others are reachable. A machine that was told of the unpair only by replication is treated the same as one told directly: it gets no key.
If the removed machine had introduced another machine to a peer that had not yet heard of the unpair, that machine is not paired: it shows under Machines in this mesh as "Added by <removed machine> after it was unpaired — not paired until you confirm", with Keep paired and Remove.
The per-machine messaging switch
Settings › Network › Machines in this mesh › Agents can message is per machine. Off adds the machine's id to mesh.messaging_off. A send to or from that machine is refused: send_message: communication_disabled: agent messaging between <this machine> and <other> is off on <this machine>. It is independent of the global agent.communication setting.
What replicates between mesh engines
Every durable session is mirrored to every engine as a changeset log. Besides sessions: tasks, roster agents and their budgets, projects, paired devices, the secrets vault, the document index, and the files under skills/, schedules/ and mcp/*.json. Private sessions (the Private switch in a new chat) never replicate.
One engine owns each session and is the only one that runs it. In the sidebar a session owned elsewhere carries an engine chip. Using it from another engine never moves it:
- Writes forward to the owner. Sending, steering, stopping, approving, and the session settings in ⋯ (Approvals, Agent messaging, Model, Effort) all run on the owner; the composer reads
Message — runs on <engine>(Runs on <engine>in a narrow window). Agent desks and your own chats follow the same rule. - Live while you watch. The open chat streams the owner's reply, tool progress, approval cards and questions as they happen; the header chip reads
on <engine> · live. An approval relayed from the owner reads<engine> asks: <tool>with<risk> · relayed from <engine> · denies at <time>, and Allow or Deny on any machine answers it on the owner. A chat that is not open shows its running glyph in the sidebar. - Owner offline: nothing runs. When the owner is not connected the chip reads
on <engine> · offline, the setters in ⋯ are greyed, and a send showsOwned by <engine>, last seen <ago>. Continue here now?at once. Continue here takes the session to this engine and then sends; Wait keeps your draft./takein the composer does the same.
To send a session to another engine on purpose, open its ⋯ menu and pick Move to ▸ <engine> (on a chat owned elsewhere the owner does the move). The list shows every paired engine with a dot for online; an offline one is greyed out with how long it has been gone. One click moves it: a turn that is running pauses here and resumes there, and running jobs stay behind (the subtitle says how many). Both machines then show a Session moved to <engine> · <OS> · <folder> card (from <engine> · <time> · approvals kept: Ask, and "What the agent was told"); the model's next turn is told which machine, OS and folder it now works in. A move during a running turn shows Resumed on <engine> after N s · moved from <engine> above the tool call it interrupted. The origin's header shows on <engine> and a line reads Moved to <engine> at HH:MM — it runs there; what you send here runs there too. with a Continue here button; the other engine shows The session moved here at HH:MM — moved from <engine>. Errors come back in plain words: <engine> is offline, this session is not owned here, <engine> refused: …. Opening or reading a session on another engine never moves it.
To start a chat on another machine, use New chat on [<engine> ▾] at the top of a new chat (shown once you have paired engines), the ▸ beside the sidebar's Chat, or New chat on <engine> in ⌘K. Pick a folder there (Browse <engine>… completes paths on that machine); the chat is created on, and owned by, that engine, works in that folder, and its system prompt names the machine (Machine: <name> (<OS>, <arch>)).
Some sessions cannot move, and the menu item says why: a paused agent's desk and everything under it (<agent> is paused — un-pause it before moving), an agent desk (it stays on the engine that runs its agent), and an external harness session such as omp (a process on this engine). If the other engine refuses after the running turn was paused here, the turn resumes here and the message ends It continues here.; if it does not answer within the take's time limit you get no answer from <engine> yet — the move may still land, and the sidebar shows where the session ended up.
A session's per-chat settings travel with it: the Approvals pin (On, Off, or the machine default) and the Agent messaging opt-out are stored on the session and apply on whichever engine owns it.
Contacts: one list for every machine
A contact is another person's theuth you paired with; adding one, what it may reach, files and Full access are on Contacts. The contacts list lives in Settings › Sharing › Contacts (it moved there from Network). This section covers what the mesh adds: a contact is a contact of the whole mesh, not of the machine you paired on. The record replicates, so every machine of yours lists the same contacts, each once, and any of them can message the contact or answer it with its own key. Rename, Block…, Remove… and what a contact may reach apply on all your machines; the Block and Remove confirms say so.
Three things on a contact's row are this machine's own view, so two of your machines can differ for a moment while an update reaches them:
- Their machines —
Their machines: laptop · studio: the contact's machines this machine accepted, from the list (roster) the contact's own mesh signed. A name comes from that machine's card; until this machine has fetched it (after a restart, say) the first 8 characters of its id show. A machine the contact's roster no longer lists stays struck through, labelledleft. A contact whose roster has not reached this machine yet lists the machines it was paired with. - Paired on <machine> — the machine of yours whose code check made the contact; the first 8 characters of its id once that machine has left your mesh.
- The path chip (
LAN,Relay,offline) and a problem line, which says what the row offers:
| Problem line | What it means | What to do |
|---|---|---|
In red, with Remove…: cannot verify this contact's machines, this contact's machines disagree about yours; remove and pair again, removed on another machine, now one of your machines, its binding was revoked on this machine, its merge chain loops, a malformed name, binding or endpoint | This machine refuses the contact: the record is unsound, or this machine cannot prove which machines are the contact's. It does not mend by itself. The row has no other action and reaches nothing. | Remove…, then pair again. |
In grey, no action, · this clears by itself: its name is taken by another contact (renaming), an endpoint is in another contact too (merging), it was merged into a contact this machine lacks (…), none of its machines can be admitted | The record is held while replication catches up on this machine (a rename or a merge from another machine is on its way). | Nothing. It clears by itself; Remove would delete a sound contact. |
In red, with Network › Machines and Remove…: a machine of <contact> follows a roster we never signed; one of ours may be compromised | An alert only: the contact still works. A machine of the contact asked for a version of your machines' roster that none of yours signed, so a key of one of your machines may be in other hands. | Check your machines: the fix may be to unpair one you no longer trust (Network › Machines). Removing the contact is not the only way out. |
A lost or stolen machine. Unpairing it tells your contacts it left (a contact that is offline learns it when it comes back); once that reaches them, they refuse it. A machine in other hands may still reach them until then, so the Unpair dialog and a contact's Remove confirm both say: Ask <contact> to remove you too, then pair again. Until they do, the removed machine may still reach them. The remedy needs both sides.
Full access. The per-contact Full access switch (Settings › Sharing › Contacts › Access) lets any of the contact's sessions message and list your sessions as if it were another machine of yours, except that nothing is synced; see Contacts for its scope. Private chats, your other contacts' conversations, advisors and sessions your own mesh policy keeps apart (an isolated root, an opted-out chat) answer exactly like a session that does not exist. The row's last line says whether the contact gave you full access (<contact> has given you full access: …, has not given you full access, or does not support full access yet for an older theuth).
When a contact gives you full access, its sessions show under its peer:<contact> row in the chat's Peers list and in the terminal's /peers as peer:<contact>/session:<uuid>, newest first, at most eight; the contact's row reads full access · more: discover_peers(kind="contact", query="<contact>") when there are more (type the contact's name into the Peers filter to list them all). Your sessions can message them; none opens a transcript here (the desktop row has Copy, no Open). A machine of the contact that does not answer within 2 s is named in a partial: no answer in time from <contact>/<machine>, … line under the list; Retry (r in /peers) asks again. Turning your switch off refuses at once on the machine you flip it on, and on your other machines as each receives the change (normally seconds); a machine that is offline keeps the old setting until it reconnects, and blocking or removing the contact there cuts it off at once.
The hub
Connected engines elect one hub. A freshly paired engine is barred from the lease for mesh.probation_secs (6 h); a hub that shuts down cleanly hands over within mesh.handover_secs (600 s). When two engines that both hold the lease meet — a first pairing, or a network split that heals — the better-ranked one keeps it within a heartbeat and the other lets go at once (mesh: lease → … (two holders) in the log); an engine that starts up while another already holds the lease waits for its heartbeat and keeps that holder — for its first mesh.lapse_secs + 30 s it follows a connected holder that has been up longer even when it outranks it, so a restart never pulls the hub over. Your preference is mesh.hub: prefer, eligible (default) or never, set with t mesh hub … or the Prefer this node as hub select in Settings › Mesh. A routine without an engine: line shows a not hub chip on a non-hub engine (ticks are the hub's duty there); one made on another machine shows other machine and fires only there. Settings › Mesh also shows Sessions: N here · M elsewhere and the replication log seq; the desktop HUD reads k/n nodes · hub here or hub <name>.
Running work on another machine
The model sees every engine through mesh_peers, one line each:
this engine id=… reachable class=laptop harnesses=native,omp repos=~/src/app display=true gpu=false
build-box id=… reachable class=server harnesses=native,claude repos=~/src/app display=false gpu=true hubIt targets a machine with spawn_subagent{agent: "<node>"} or "<harness>@<node>" (resolved by node name, else a unique mesh-id prefix), or with a task's where / harness fields (Tasks). Mesh engines are registered as spawn targets automatically, marked · offline while away; nodes over SSH the same way. Approvals a remote child needs come back to whatever UI you are using; anything other than Allow is a deny. There is no node_exec or file-copy tool: artifacts and attachments are fetched on demand, and the only shared folders are sandbox --share mounts.
Devices and the link relay
A device connects to the relay over a WebSocket and runs a Noise handshake end to end with your engine, so the relay forwards ciphertext. Two kinds of pairing exist:
- Mesh pairing (4-part key, Settings › Link › Devices › Pair a device,
t mesh devices add,/mesh devices add): the device pairs with the mesh. Any node can show the QR; whichever node holds the hub lease answers. The device list is replicated, and revoking a device cuts it off at every hub within about 2 s. When the hub moves, the device showsreconnecting…and redials the same mesh id; measured at about 31 s after a hard kill of the hub. - Legacy pairing (3-part key,
t --link,/link pair): the device pairs with this engine alone. They are listed under Legacy devices in Settings › Link and keep working; re-pair with the mesh to reach every node.
Either QR encodes https://<relay-host>/link#1.… — the secret is in the URL fragment, which browsers never send to the server. A pairing is valid for 5 minutes, one can be pending at a time, and an engine refuses new devices past link.max_devices (16). A phone without the app lands on the page the relay serves and pairs there.
Walkthrough: a laptop and a build server
Goal: the laptop (desktop app) and a Linux build server become one theuth; builds run on the server from chat; you follow along from the phone.
1. Start the server engine. On the server, after installing theuth and a model key:
t --install-service --no-pair--no-pair skips the link QR. The name other nodes see is mesh.name in that machine's config.yaml, else its hostname — set it to build-box before the service starts if the hostname is not what you want.
2. Pair it. On the server, t mesh pair prints a string. On the laptop open Settings › Network › Advanced, paste it into the paste-a-pairing-string box and press Add. (Or skip the string: open Settings › Network on both and pair from Nearby.) "Machines in this mesh" now lists build-box; t mesh status on either side shows the peer and who holds the lease. The laptop, already running, keeps the lease; the server becomes eligible after its 6-hour probation. If you want the server to end up as hub, set the hub preference under Advanced (or t mesh hub prefer on the server and t mesh hub never on the laptop).
3. Run a build there from chat. In a new chat on the laptop (messaging is on by default once paired):
› run the full test suite on build-box in ~/src/app and tell me what failsThe model calls mesh_peers, sees build-box … repos=~/src/app, and calls spawn_subagent{agent: "build-box", cwd: "~/src/app", task: "…"}. The child session appears under the parent in the sidebar with the server's engine chip. When it wants to run cargo test, the approval card shows up in your chat on the laptop — Allow or Deny as usual; it is the same Allow/Deny model described in Tools and permissions. The child's result arrives as a message in the parent session.
If you would rather hand the whole conversation to the server, open the session's menu and choose Move to ▸ build-box, or Continue here from a UI connected to the server, or type /take there. Typing into the server's chat from the laptop runs it on the server without moving it.
4. Follow it from the phone. On the laptop, Settings › Link: turn the relay on (or /link on in the terminal UI), then Pair a device. Scan the QR with the phone's camera. The phone's Pair with a mesh screen pairs it with the mesh, and the switcher shows one row for the mesh (2 of 2 nodes online). Open the running session from the phone: you see the same transcript, and an approval that is still pending can be answered there. Once the server can hold the lease (past probation, or preferred), closing the laptop does not cut the phone off: the server takes the hub, the phone shows reconnecting… briefly and redials the same mesh id.
Walkthrough: a node over SSH, nothing synced
When you only need "run things over there" and do not want the server to hold a copy of your sessions:
- On the box: the four commands from Three ways to add a machine, ending with
t --install-service --relay wss://…. Copy the key it prints. - In the terminal UI on your main machine:
/nodes add <key>. Or Settings › Network › On another computer over SSH › paste › Add. /nodeslists it as<platform> · theuth <version>(or· offline). Ask in chat:
› use omp on build-box to bisect the flaky integration testThe model runs spawn_subagent{agent: "omp@build-box", …}; approvals come back to you. /nodes rm <n> removes it — the node's own ~/.theuth is untouched, and your devices stay paired with it until you revoke them in its Link settings. t --uninstall-service on the box removes the service unit and nothing else.
Reference
Configuration
All keys live in ~/.theuth/config.yaml; any key can be overridden with THEUTH_<SECTION>__<KEY>. Changes need a restart unless noted.
mesh:
| Key | Default | Meaning |
|---|---|---|
relay | https://iroh.relay.theuth.io | iroh relay for mesh traffic. public = n0's public relays; none, off or "" = never dial a relay. |
discovery | true | Peer discovery. |
name | "" | This machine's name as other machines see it; hostname when empty. Editable in Settings › Network. |
bind | unset | ip:port to bind the QUIC endpoint. |
hub | eligible | prefer | eligible | never. Written live by t mesh hub … and Settings › Network. |
probation_secs | 21600 | A new joiner cannot hold the lease for this long. |
handover_secs | 600 | Graceful handover window when the hub leaves. |
heartbeat_secs | 10 | Heartbeat interval. |
messaging_off | [] | Engine ids that agent messaging is refused for, both directions. Set by the Agents can message switch (mesh_set_messaging(id, on)). |
nearby | true | Advertise on and accept pairing from the LAN (mDNS) while Settings › Network is open or a pairing window is open. |
pair_window_secs | 120 | How long Nearby stays open after t mesh pair or a shown pairing string. |
lapse_secs | 30 | Heartbeat lapse before a peer counts as gone. |
capabilities_secs | 300 | How often harnesses/repos/display/GPU stats are refreshed. |
workspaces | [] | Repo paths advertised in mesh_peers repos=. |
class | unset | server | desktop | laptop | container | vm, shown as class= in mesh_peers. |
availability_flush_secs | 600 | Availability record flush interval. |
storm_frames_per_sec | 50 | Replication frame rate cap. |
sessions:
| Key | Default | Meaning |
|---|---|---|
takeover_secs | 300 | Owner must be unseen this long before an automatic take (the orphan sweep) claims its sessions. A write from the desktop, TUI or phone never takes: it forwards, or asks you to Continue here. |
release_wait_secs | 10 | Wait for the old owner to release on a user-initiated take; also how long a new chat started on another machine waits for its row to arrive here. |
orphan_keep_days | 7 | How long orphaned sessions from a removed engine are kept. |
link:
| Key | Default | Meaning |
|---|---|---|
enabled | false | Relay uplink on/off. Toggled live by /link on|off and Settings › Link; the mesh uplink follows the same switch. |
relay | wss://relay.theuth.io | Must start with ws:// or wss://. |
name | "" | Name devices see; hostname when empty. |
max_devices | 16 | Pairing is refused past this. |
guest_handshakes_per_minute | 10 | Share-link guests admitted per minute. |
nodes:
| Key | Default | Meaning |
|---|---|---|
enabled | true | false: no dials, nodes invisible to the model and UI; nodes.yaml kept. |
Data files in ~/.theuth: mesh.sqlite, replica.sqlite, link.sqlite (devices and pending pairings), nodes.yaml, the mesh/ and link/identity key material, and a vault row mesh/device_key.
Tools the model calls
| Tool | Risk | Arguments |
|---|---|---|
mesh_peers | read_only | reachable?: bool — one line per engine: <name> id=<id> reachable|unreachable class=… harnesses=… repos=… display=… gpu=…[ hub]; the local engine is this engine. |
spawn_subagent | read_only | agent: "<node>" or "<harness>@<node>", task, name?, cwd?, model?, effort?, tools?, skills?. <harness>@<this engine> collapses to the local harness. |
task_create, task_place, … | mutating | where (an engine name from mesh_peers) and harness pick where a task runs. |
sandbox_* | see Sandboxes | VMs this machine makes itself; they join the mesh as engines. |
CLI
All t mesh … subcommands are RPC calls on the running engine on this machine.
| Command | Does |
|---|---|
t mesh status | This engine, its peers and who holds the hub lease (JSON). |
t mesh pair | Print a pairing string for t mesh add elsewhere (5-minute token). |
t mesh add <string> | Pair with the engine that printed the string. |
t mesh add --ssh TARGET [--key NAME | --system-ssh] | Install and pair an engine over SSH. |
t mesh add --docker [--name …] [--image … | --local-t] | Pair a container engine. |
t mesh add --vm [--name --cpus --memory --disk --share HOST[:GUEST][:ro] --no-desktop --network …] [--image … | --bootstrap] [--local-t] | Create and pair a sandbox VM. |
t mesh remove <id> | Unpair an engine and rotate the vault key (mesh_remove(id, reset_devices) also resets phone and iPad pairing). |
t mesh hub prefer|eligible|never | Set and persist mesh.hub. |
t mesh devices list|add [name]|revoke <id>|rename <id> <name> | Mesh-paired devices. |
t --link | Legacy per-engine phone pairing: QR + key, expires in 5:00. Needs a running t --headless. |
t --install-service [--relay URL] [--name N] [--no-pair] | Install the headless service; prints a node key unless --no-pair. |
t --uninstall-service | Remove the service unit only. |
Slash commands (terminal UI)
| Command | Does |
|---|---|
/mesh devices [list|add [name]|rm <id>|name <id> <name>] | Devices paired with the mesh (any node serves them). |
/nodes [add <key>|rm <n>|name <n> <name>|invite <n>] | Machines this engine can run sessions on. |
/link [on|off|pair|cancel|rm <id>|name <id> <name>|relay <url>] | Relay uplink and legacy devices; bare /link opens the modal. |
/take | Take the current session's ownership here. |
Desktop
- Settings › Network (
/settings/meshredirects here): a rotation banner while a vault-key rotation runs; "This machine" (OS icon, editable name, 8-character id with copy, chipsLAN · mDNSandRelay · <host> · <ms>, and the "Let nearby machines find this one while pairing" switch); Nearby; "Machines in this mesh" (name,hubbadge, OS and class, path chipLAN 2 ms/Relay 41 ms/offline 3h, Agents can message, ⋯ Rename · Unpair…); Advanced (hub preference, Rotate vault key, Show pairing string, paste a pairing string, On another computer over SSH); Sandbox VMs. - Settings › Sharing › Contacts: every contact of the mesh once, with its machine and fingerprint,
Their machines: …(aleftone struck through),Paired on <machine>, the path chip, a problem line with its action (see Contacts), what it may reach, and ⋯ Rename · Choose what it may reach · Block… · Remove…; Access below it. - Settings › Link: relay toggle, "This node" link identity, hub status (
this node is the hub: serving the mesh's devicesoranother node holds the hub lease), Devices with Pair a device, rename, revoke, and Legacy devices. - Engine switcher (header): the local daemon as
LOCAL, mesh rows withN of M nodes online, nodes nested under their parent; chipsreconnecting…andrevoked — pair again. - Session menu: the session's settings (Approvals ▸ On / Off / Machine default, Agent messaging, Model ›, Effort ›; headed
Settings for this session on <engine>for a chat owned elsewhere), then Continue here (owned elsewhere) and Move to ▸. New chat: New chat on [machine ▾] and its folder; the sidebar's Chat ▸ and ⌘K list the same machines.
Safety and permissions
- Tool calls on a remote engine follow the same policy as local ones: risk
read_only|mutating|destructive→tools.policy→ an Allow/Deny card in whatever UI you are using (desktop card, TUI[y]/[n], Slack or Telegram buttons, Signal 👍/👎 or/approve <code>). The remote child's request is forwarded as-is; a timeout aftertools.approval_timeout_secs(300 s) or any answer other than Allow is a deny. No per-tool "always allow" exists;/approvals off(session) or/approvals off alwaysare the only switches. Details: Tools and permissions. mesh_peersis read-only and never asks.spawn_subagentis read-only by design; the child's own tool calls are what ask.- Mesh pairing is a trust decision: the joiner adopts the inviter's vault data key and receives every replicated secret, session and document. Pair only machines you control.
t mesh remove <id>unpairs and rotates the vault key, so nothing written afterwards reaches the removed machine; the copies it already holds, and the old secrets, remain there — replace them at their providers if it is lost. - A node over SSH receives none of that; it holds its own vault and config. The parent can only start sessions on it.
- Mesh traffic is QUIC with TLS keyed by each engine's identity; the iroh relay (
mesh.relay) only forwards when a direct path fails. - The link relay keeps no state and no accounts. After the WebSocket upgrade everything is Noise-encrypted end to end, so the relay — ours or yours — sees ciphertext, frame sizes, timing, IP addresses and the harness/mesh id, never your messages, keys or which device is connected. The pairing secret is in the URL fragment and never reaches it.
- Revoking a mesh device marks it revoked everywhere (the row is kept, never deleted) and every hub refuses it from then on. Revoking a legacy device deletes its row on that engine.
Self-hosting the relay
Any theuth relay works; the default link.relay is the operator's.
just web-build # browser UI → crates/desktop/ui/dist
cargo run -p relay -- --listen 0.0.0.0:8787 --web crates/desktop/ui/dist # plain; put TLS in front or add --tls CERT KEY
RELAY_HOST=relay.example.com docker compose -f deploy/relay/compose.yaml up -d # or: relay + Caddy with automatic TLS
# then in config.yaml: link.relay: wss://relay.example.com--max-conns (default 64) caps connections per harness.
Limits and lifecycle
| What | Value |
|---|---|
| Pairing validity (mesh string and device QR) | 5 min; one pending device pairing at a time |
| Devices per engine | link.max_devices = 16 |
| Hub probation for a new joiner | 6 h (mesh.probation_secs) |
| Graceful hub handover | 600 s (mesh.handover_secs) |
| Device reconnect after a hub crash | about 31 s measured |
| Revocation reaching every hub | about 2 s (one replication hop) |
| Write takeover of a session | never from a client write: writes forward to a connected owner, and an offline owner asks you to Continue here |
| Orphaned sessions kept | 7 days |
| Node over SSH control connection | reconnect backoff 1→30 s, keepalive 300 s, presence wait 10 s |
| Relay per-device idle | 600 s, then CLOSE 2 |
| Relay connections per harness | 64 (CLOSE 3 past that) |
| Relay payload | 65 535 bytes per frame; 10 upgrades/s per IP (HTTP 429 beyond) |
| Mesh rows at startup | local-only after 10 s without a replica attach |
Not available as of this writing: a Settings › Nodes tab (it is Network), devices over iroh (devices always use the link relay), and a per-engine devices.yaml (replaced by the replicated link.sqlite).
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
no harness on <addr>; start t --headless first from t mesh … | No daemon is running on this machine; the subcommands are RPC clients. | Start t --headless (or the desktop app) and retry. |
A node row reads · offline or mesh_peers says unreachable | The remote engine is down, its service did not start, or it cannot reach the relay. | On the box: is the service running? t --install-service waits 15 s for the port and reports failure otherwise. Check link.relay / mesh.relay there. A mesh row is unreachable whenever its QUIC connection is down. |
another engine holds the hub lease when editing a document | Live document edits are a hub duty. Your engine could not reach the current holder (handover in progress, or no eligible node). | Wait a few seconds and retry; edits forward to the hub automatically once it is reachable. Check t mesh status for the holder. |
Routines show not hub and never fire here | This node does not hold the lease; ticks are the hub's duty. | Expected: they fire on the hub. To move the hub, t mesh hub prefer here and t mesh hub never on the other node; a new joiner waits out 6 h probation first. |
Phone or browser shows revoked — pair again | The engine answered refused: every hub forgot this device, usually because it was revoked. | Pair again from Settings › Link › Pair a device (or /mesh devices add). |
Phone shows reconnecting… for longer than a minute | Hub failover (CLOSE 4 / CLOSE 5) and no node currently holds the lease, or the surviving node has link.enabled: false. | Make sure at least one eligible node is up with the relay enabled; t mesh status shows the lease. |
Composer says Owned by <engine>, last seen <ago>. Continue here now? | The session's owner is not connected; nothing ran. | Continue here takes it and sends (turns not yet shipped from the old owner stay there), Wait keeps your draft. |
t --link says it needs the daemon | Legacy pairing talks to a running engine. | Start t --headless first. |
| Pairing a device fails after 16 devices | link.max_devices reached. | Revoke an old device in Settings › Link, or raise link.max_devices. |
/nodes add worked but my sessions are not on the node | Expected: a node over SSH is not synced. | Pair it into the mesh with t mesh pair / t mesh add as well. |
| Nearby list is empty | Settings › Network must be open on both machines, Let nearby machines find this one while pairing on, both on the same LAN, and on macOS Local Network permission granted. | Fix the one that is missing; the list shows unpaired machines only. |
too many failed pairings from this machine | Three failed ceremonies from this machine in the window. | Close and reopen Settings › Network, then pair again. |
A machine is named runs an older theuth | It predates vault-key rotation and cannot read secrets after one. | Upgrade it. |
spawn_subagent with agent: "build-box" is not offered | agent.communication is false, build-box is in mesh.messaging_off, or no machine is paired and the key is unset. | Pair a machine, remove the explicit false, or switch Agents can message on for it. |
Related
- Delegation —
spawn_subagent, children and their limits - Tasks —
where/harnesson tasks - Sandboxes — VMs this machine makes and pairs itself
- Schedules — routines fire on the hub
- Sessions — ownership, private sessions, compaction
- Tools and permissions
- Secrets — the vault that mesh pairing shares
- Configuration
- Contacts: other people's theuth, shares, files and Full access
- Sharing: everything you share, and public links
- Security
- CLI
Autoresearch
Give theuth a goal and a benchmark, and it runs measured experiments unattended in its own git worktree, keeping only changes that beat the measured noise and pass your check.
Contacts
Pair with another person's theuth so your agents can message the agents and chats you share, send files of up to 5 GB, and, if you choose, reach each other's sessions with Full access.