Skip to content

Tag an agent on another linked computer into a thread - #3989

Merged
backnotprop merged 11 commits into
mainfrom
feat/tag-agents-across-computers
Nov 24, 2026
Merged

backnotprop merged 11 commits into
mainfrom
feat/tag-agents-across-computers

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

e2e: inbox-tag-across-computers.spec.ts inbox-tags.spec.ts inbox-tag-handoff.spec.ts inbox-machines-agent-read.spec.ts inbox-session-label-surfaces.spec.ts

What a person can do now

In any thread, @ lists the agents of every linked computer that takes the mark tag-across, after this computer's own. On a linked computer that means its live sessions whose connection polls, plus the Codex, Qwen, T3, Antigravity and webhook cloud-agent sessions it wakes itself. A far row reads "Claude Code (Laptop)", with "web · Laptop" as its detail. Once the list spans computers, this computer's own rows name theirs too ("api · Studio"). With one computer alone, no computer is named.

Pick one and Send. Ask, Add and Hand off mean what they mean locally. The thread's computer pushes the wake to the agent's computer through its outbox. The wake has the same command a local poll would get: the tagged line, the details line (context), and a handoff or Add when there is one. The agent's computer hands it to that session with its next poll, or through its own wake (Codex, Qwen, T3, Antigravity, a cloud agent with a wake address). Its delivery goes back, so the line under the reply reads delivered on both computers. Take back before the session took it withdraws the wake there. Send now pushes it again into the running turn.

The agent reads the thread with read_thread and answers with send_message reply_to. Any session on a linked computer may answer in a thread it can read, tagged or not, just as any agent may write in any thread locally. Its send_message runs on the thread's computer with every field, by that computer's rules: files and the pictures its body shows (read from the agent's disk and uploaded first), steps, PRs, a branch report, Priority, a thread name, supersedes, done. Its refusal is the agent's refusal and its answer the agent's result, with machine added. The message's author carries machine and machine_name, so its head reads "web · Laptop" on every computer and the phone. Later replies addressed to it reach it the same way.

It works in every direction, with a third computer that is linked to the thread's computer, and from the phone. The phone reads the same taggable route. Its tags carry no machine, so the thread's computer takes a tag with no computer as a far one when exactly one linked computer lists that session and it is not one of its own.

Keys, refusals and away

  • Each far answer's key is its session's own. The outbox key hashes session, thread and the agent's idempotency_key; the key sent on hashes session and key. Two sessions that both send reply-1 both get there. The same session's retry answers its first send, and its key reused for other words is idempotency_key_reused, as a local send's.
  • The thread's computer on an older Plannotator (its list lacks tag-across): the answer is refused at once with thread_on_other_machine, and nothing is held. Its agents are not offered in @.
  • The thread's computer away: words wait in the outbox ("Waiting for Studio: …", held: true) and go when it is back. Files are refused (machine_offline). An answer held this way and refused there later becomes an outbox notice: under that thread, this computer's window shows the held write's line "Not delivered: ." with Dismiss. One refused while the agent waited is only the agent's refusal.
  • A far tag whose session the thread's computer's list (as last read) does not name is read there once more before it is refused, so a restart since @ opened does not refuse it.
  • Wakes on the agent's computer (inbox/far-wakes.jsonl, 0600): at open, delivered or withdrawn ones go after 7 days. Ones no session took go after 30 days (the outbox's notice keep); the thread's computer sends the wake again with the thread's next message. The file is rewritten with one line per wake (temp file, then rename).

Routes (all on DOOR_OWN_ROUTES: a linked machine's token only, never on the phones' allowlist)

  • GET taggable-agents: this Inbox's agents that a linked computer may tag: session, host, label, project name only (no id, no root), times, busy, send_now, taggable.
  • POST far-wake (outbox set): a wake for one of this Inbox's sessions. Only the fields a reply's wake has are kept, each checked; the url becomes this Inbox's own thread page. withdrawn: true takes one back; replaces: true (Send now) replaces one not yet taken.
  • POST agent-reply (outbox append): one of the asking computer's sessions runs send_message in a thread here. It is refused only for a session that is not that computer's: one of this computer's own, or one known on another computer (403 not_your_session). An unknown message is 404 message_not_found.
  • POST far-delivered (outbox set): that session took the wake. It records the delivery for that session only.

Each route takes the machine from the door token alone. A phone, or a device with no link, gets the unknown-route 404, and the forward refuses all four. There are no gates, confirmations or settings.

Agent-facing words

The existing wake lines and the local refusals (session_not_live, tag_needs_update, idempotency_key_reused, thread_on_other_machine) are reused as they are. The new strings are DRAFT, waiting for the owner's yes.

Also in this PR

  • agentName (packages/inbox/tags.ts, and TagRules.agentName in the iOS app): an agent named by its host id ("gemini") reads by its product name ("Gemini CLI").

Not the same yet (gaps in inbox-machines.md)

  • A cloud agent with no wake address (it checks for messages itself, Muse) and an MCP-only agent are not offered.
  • A third computer reaches a thread only when linked to the thread's computer, and @ does not say why another computer's agents are missing.
  • Files to a computer that is away are refused, not held.
  • A held answer refused later shows the refusal line under the thread, not the agent's words: the held-write row draws its words as the person's.
  • The iPhone app offers far agents and can tag them, but its rows do not name their computer (it does not read machine_name yet).

Tests

  • Local, one file at a time: packages/server/inbox-far-answers.test.ts, packages/server/inbox-far-tags.test.ts, packages/server/inbox-outbox.test.ts, packages/server/inbox-peer-link.test.ts, packages/server/inbox-artifacts-merged.test.ts, packages/inbox/tags.test.ts, packages/inbox/machines.test.ts, packages/inbox/tagPickerComputers.test.tsx (DOM), tests/child-env-guard.test.ts, tests/windows-hide-guard.test.ts, tests/inbox-structure.test.ts, scripts/dom-test-allowlist.test.ts; swift test in apps/mobile/ios/InboxCore; tsc for core, server and inbox; bun scripts/mobile/check.ts.
  • CI only: tests/e2e/inbox-tag-across-computers.spec.ts (two compiled Inboxes), packages/server/inbox-machines.test.ts and packages/inbox/tagAgents.test.tsx (each starts an Inbox).

The @ list in a thread lists the live agents of every linked computer.
A tag names the agent's computer; the thread's computer pushes the
wake there through its outbox, and the agent answers with reply_to
into the far thread, written there as that agent with its computer.
Fix a picker heading that repeated its first row and a lowercase
gemini name.
@backnotprop backnotprop added the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 24, 2026
…s-computers

# Conflicts:
#	apps/mobile/contract/generated/swift/Wire.swift
#	apps/mobile/contract/parity/ledger.json
#	packages/core/inbox-types.ts
#	packages/inbox/tags.ts
An agent on a linked computer writes into a thread there as it would
locally: untagged too, with files, pictures, steps, PRs, Priority, a
thread name and a branch report. Its files go to that computer's
uploads route first. Take back and Send now reach a pushed wake, and
the wake's details line crosses.
The four wakes the Inbox runs itself are given the store with each far
wake that waits added as one more tagged item for its session, so a far
tag goes through codex queue (and Qwen, T3, Antigravity) the way a local
tag does, and its delivery is told to the thread's computer. These
sessions are now in the list a linked computer tags from.

Also pins farSendMessage: fields carried, the session and computer
taken from the token, files only as uploads, the tool's refusals.
The cloud wake is given the same store as the other self-waking hosts:
a far wake for a cloud agent with a wake address is posted to its
webhook once, its state is kept on the far wake, and a started run is
told to the thread's computer as delivered. Such agents are listed for
linked computers.
…-agents-across-computers

# Conflicts:
#	apps/mobile/contract/generated/swift/Wire.swift
#	apps/mobile/contract/parity/ledger.json
#	apps/mobile/contract/parity/surface.json
#	packages/core/inbox-types.ts
#	packages/server/inbox-machines.ts
… id by its product on the phone

The branch report's git call in inbox-mcp-far-reply.ts now passes childEnv() and windowsHide like every
other spawn in the server. The iOS tag list's agentName follows the window's: an agent id such as
"gemini" reads as "Gemini CLI", so the phone's rows match vectors/writing.json.
… computers

- A far answer's outbox key is the session's, the thread's and the agent's key
  together, and the key sent on is the session's own, so two sessions that use
  the same key both get there. The same session's retry answers the first send;
  its key reused for other words is refused, as a local send refuses it.
- An older Plannotator on the thread's computer (no tag-across mark) is
  refused at once with thread_on_other_machine instead of being held.
- A held far answer refused there later is an outbox notice, shown under that
  thread in the window like any held write that did not land.
- A tag that names no computer (the phone's) is the far computer's when exactly
  one linked computer lists that session and it is not one of this computer's.
- Before a far tag is refused as not live, that computer's agents are read once
  more, so a restart since the @ list opened does not refuse it.
- Far wakes no session took are pruned after the outbox's notice keep, and the
  file is compacted at open.
- The @ picker draws every group heading again, as on main.
…y as a local send does, keep a dropped far answer's words

- The reply route reads a far tag's agents before its seen_through_seq check, so an agent's message written while
  they are read is not missed.
- A far answer's reused idempotency_key is compared as a local send's (one shared comparison, send-same.ts).
- A held far answer's words are read from its arguments, so Settings → Machines keeps them after an Unlink;
  several dropped by one Unlink show one toast.
- Tests: the outbox frame filter for a notify entry, and a reused key with another done.
…-agents-across-computers

# Conflicts:
#	apps/mobile/contract/generated/swift/Wire.swift
#	apps/mobile/contract/parity/ledger.json
#	packages/core/inbox-types.ts
#	packages/server/inbox-outbox.ts
@backnotprop
backnotprop marked this pull request as ready for review November 24, 2026 15:46
@backnotprop
backnotprop merged commit 800fc3a into main Nov 24, 2026
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:e2e Run the full browser suite (Inbox window e2e) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant