Zum Inhalt springen
↑↓Navigieren ↵Öffnen escSchließen

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Agent Collaboration

Agent Collaboration (A2A, short for agent-to-agent) lets agents on different computers work together. You share one of your sessions as an “agent” with a name and a description. Someone else adds it to their TokenWork, and their agent can send it questions or tasks. The answer comes back into their conversation.

A typical case: you have a session that knows your frontend code well. You share it as “Frontend reviewer”, and a teammate’s agent asks it to check a change without opening your project.

Before you start

On the computer that shares a session:

  1. Open Settings → Agent Collaboration.
  2. Under General, turn on Accept agent requests from paired peers.

While this is on, the header shows A2A on. If you turn it off, every link you shared stops working until you turn it back on. TokenWork must also be running on this computer for others to reach your session.

To receive shared sessions you need the TokenWork desktop app.

Share a session

  1. Open the session you want to share.
  2. Click the share button at the bottom of the message box (Share this session).
  3. Fill in Agent name and Agent description. Recipients see both before they connect, and their agent uses them to decide when to ask yours. Click Generate with AI to draft them from the conversation.
  4. Under What the recipient may do, pick one:
    • Read only (default): the agent can read and search this computer. Writing files, editing, and shell commands are refused.
    • Full access: the other person’s requests can write files and run shell commands on this computer. Pick this only for people you trust.
  5. Click Create link.

The link (it starts with tokenwork://share) is copied to your clipboard. Send it to the recipient. You can’t see this link again after you close the window, so copy it now. The link works like a password: anyone who has it can use this session until you revoke it.

How recipients reach you

The link contains every way your computer can be reached right now. The recipient’s app tries them and uses the first that answers.

  • Private Relay: an encrypted connection through the TokenWork relay. Works from anywhere with no setup and is always included.
  • LAN: fastest, but only for people on the same network. Turn on LAN access in network settings first. This needs a UI password.
  • Tunnel: a public address from Cloudflare or ngrok. A quick tunnel gets a new address each time it starts, so make a new link after restarting it.

If the window says “This install is not reachable from other devices”, start a tunnel or turn on LAN access, then rotate the link. See Tunnels and Private Relay.

Manage what you shared

Go to Settings → Agent Collaboration → Shared sessions. For each shared session you can:

  • Edit: change the agent name and description. Recipients see the change the next time they open their shared sessions.
  • Rotate: replace the link. The old link stops working right away. Send the new one to people who still need it.
  • Revoke: stop sharing. This can’t be undone. To share again, create a new link.

Add a session someone shared with you

  1. Click the tokenwork://share link you received. TokenWork opens it. You can also paste it in Settings → Agent Collaboration → Shared with me and click Add.
  2. Check the agent name and description in Connect to this shared agent?. If the link has no name or description, confirm with the sender first.
  3. Click Connect to my agent.

The session appears under Shared with me with its connection status:

  • Ready: you can send work to it.
  • Turned off there: the owner turned off agent requests.
  • Token rejected: the link was rotated or revoked. Ask the owner for a new one.
  • Unreachable: the owner’s computer can’t be reached right now. TokenWork retries a few times on its own.

Send work to a shared session

There are two ways.

Type /a2a yourself. In the message box, type /a2a, pick the shared session from the list, then write your message:

/a2a @frontend-reviewer Check whether this hook re-renders too often.

Let your agent decide. When you mention a shared agent (“ask the frontend reviewer to check this”), your agent can send the request on its own. This uses the Agent A2A delegation setting. If your agent never delegates, check that this setting is on and restart OpenCode.

The request shows as a card in your conversation, then Delegated answer from {name} with the reply. The reply is Included with your next message, so your agent can use it right away. While a request runs you can click Stop waiting, which also stops the work on the other computer. When it’s done, Dismiss hides the card.

Some cases you may see:

  • Waiting for host approval or Waiting for host answer: the other agent needs its owner to approve a permission or answer a question. You can’t approve it for them. Work continues when the owner responds.
  • Still running there: your agent stopped waiting after about 5 minutes, but the other side keeps working. When the answer arrives, the card shows Reply arrived, and your next message picks it up.

A shared session takes one request from you at a time. Wait for the reply before sending the next one.

What the owner sees

Each recipient gets their own copy of the shared session on the owner’s computer, so two people never write into the same conversation. The copy’s title and header show who asked. If that work needs a permission or an answer, the owner gets the usual prompt in that session.

  • Troubleshooting: limits that can refuse or stop a request
  • Drafts: let someone change a copy of your project and approve what comes back
  • Private Relay: the encrypted connection used when LAN and tunnels aren’t available
  • Tunnels: make your computer reachable from other networks