Repository navigation
Tag an agent on another linked computer into a thread - #3989
Merged
Merged
Conversation
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.
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 marktag-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_threadand answers withsend_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, withmachineadded. The message's author carriesmachineandmachine_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
taggableroute. Its tags carry nomachine, 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
idempotency_key; the key sent on hashes session and key. Two sessions that both sendreply-1both get there. The same session's retry answers its first send, and its key reused for other words isidempotency_key_reused, as a local send's.tag-across): the answer is refused at once withthread_on_other_machine, and nothing is held. Its agents are not offered in@.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.@opened does not refuse it.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(outboxset): 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: truetakes one back;replaces: true(Send now) replaces one not yet taken.POST agent-reply(outboxappend): 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 is404 message_not_found.POST far-delivered(outboxset): 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, andTagRules.agentNamein 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)
@does not say why another computer's agents are missing.machine_nameyet).Tests
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 testinapps/mobile/ios/InboxCore; tsc for core, server and inbox;bun scripts/mobile/check.ts.tests/e2e/inbox-tag-across-computers.spec.ts(two compiled Inboxes),packages/server/inbox-machines.test.tsandpackages/inbox/tagAgents.test.tsx(each starts an Inbox).