Setting Up Peers

Pro Only

To set up peers, select Autonomous Peers... from the Project menu, or from the Tasks tool's options menu, in each Wing that will send or receive tasks. The project must be open in each, from a working copy of a Mercurial or Git repository with at least one commit. Setting up is naming this Wing, choosing the mailroom, and giving it the mailroom key.

Starting Out

While neither a peer name nor a mailroom is set, the Autonomous Peers dialog opens on a start page with two choices:

  • Start a New Mailroom -- For the first Wing. Shows all the settings described below, to name this Wing, choose the mailroom, and press Generate to make its key.
  • Paste Setup -- For each other Wing. On a Wing already set up, open Autonomous Peers... and press Copy, then press Paste Setup here. Paste Setup is the default button while a copied setup is on the clipboard.

A pasted setup holds the mailroom, the Remote Host for a mailroom on an ssh host, and the key. After Paste Setup, the dialog shows a summary of the mailroom, the key's fingerprint, and the Wing it was copied from, with Peer Name and Machine Description to fill in. OK saves them and joins the mailroom. All Settings shows every setting instead.

A Remote Host already set up on this machine for the same host and ssh port is used as is. Otherwise, pasting opens the New Remote Host dialog filled in from the copied host, to add the ssh login to use from this machine, since a private key file or saved password is never copied. If that dialog is cancelled, the summary says the host is not set up and offers Set Up Remote Host... to open it again.

A folder mailroom is used where the same path exists on this machine. A path under the other machine's home directory is looked for under this one's. Otherwise, for example when the other machine runs another operating system, the summary names the folder as the other machine sees it and offers Browse... to choose where it is on this machine.

Pasting a key alone, as copied by an older Wing or Copy Key Only, sets the key and shows all the settings, to choose the mailroom by hand.

Settings

The dialog sets:

  • Peer Name -- The name other peers use for this Wing, such as mac or win-vm. A peer name belongs to one working copy, so two working copies on one machine need different names. The field suggests the machine's host name. Pressing OK with a name another Wing already has in the mailroom asks whether to take it over, as when moving a name to another working copy.
  • Machine Description -- One line that peers show for this Wing, such as Windows test box, so you and the Tasks Manager can choose which tasks to send it. By default this is empty.
  • Mailroom -- Either Local or Shared Folder and a full Path, or Directory on an ssh Remote Host, the host, and a Path on that host. See Choosing a Mailroom below. OK makes the mailroom if it is missing and the directory it is in exists.
  • Mailroom Key -- The key every peer in the mailroom shares. Press Generate on the first machine. The key is kept once per mailroom on each machine, so every Wing there that uses the mailroom has it once it is entered in one. The text below the buttons shows the key's fingerprint. Peers stay off on a machine without a key.
  • Copy -- Copies this Wing's setup, which is the mailroom, its Remote Host, and the key, to paste into Autonomous Peers on each other machine. This is Copy Setup on the button's drop-down menu. Copy Key Only (for Older Wings) copies just the key. Keep either private, since the key lets anyone with access to the mailroom send tasks to your machines.
  • Paste -- Uses a setup or key copied from another Wing. A setup sets the mailroom and its Remote Host as Paste Setup does, then the key. A key alone needs the mailroom chosen first. Wing asks before replacing a different key already kept for the mailroom.
  • Test Connection -- Saves the dialog, then checks that the mailroom can be reached and written and that this Wing's peer name is its own there. It lists each peer found, and says what needs fixing, such as a missing or different key or a peer whose Wing needs updating.
  • Leave Mailroom -- Takes this Wing out of the mailroom, so it is no longer a peer. Its peer name and the mailroom's key are kept, so setting the mailroom again and pressing OK rejoins. Wing won't leave while a task is with a peer or a peer's task is not yet replied to.
  • Peers in This Mailroom -- The peers found, with each one's description, operating system, branch, when it was last seen, and the version and build of Wing it runs. same repository marks each peer with a working copy of this repository. Wings that can't be peers, such as one with another key, are listed after them with the reason. Remove takes the selected peer out of the mailroom. A peer not seen for 10 minutes comes back if its Wing runs again. A peer seen more recently is removed only after a warning, and its Wing then leaves the mailroom within a few minutes, as if it had pressed Leave Mailroom. Its Tasks tool then shows Removed from peers, saying which peer removed it, until OK is pressed in its Autonomous Peers dialog. Wing won't remove a peer that is working on or waiting for a task, or one whose Wing is too old to leave.
  • Inbox Goal -- The goal on the Plan tab where tasks that peers send to this machine are filed. By default this is a new goal named Peer Requests. Select None: decline requests from peers for a machine that only sends tasks. File Tasks As sets whether these tasks are Ready, which is the default, or Draft, so they wait for you to read them and make them Ready.
  • Accept requests from other repositories -- Whether peers with other repositories can send this one reports and handoffs. This is checked by default.
  • Mark Complete closes the peer's copy too -- Whether marking a task that crossed machines complete here also completes its copy on the peer. This is checked by default. See Completing Tasks on Both Machines in Peer Task Details.

These settings are stored with the project, for this machine only. The mailroom key is kept in Wing's settings directory, readable only by your user account, and is never stored in a project file or in the mailroom. To leave a group of peers, press Leave Mailroom.

Wing on each machine must be running, with the project open, to receive tasks. With the Tasks Manager on there, Ready tasks from peers run without anyone at that machine.

Choosing a Mailroom

Every peer must use the same mailroom. The mailroom can be any of these:

  • A shared folder -- A folder on one machine shared into virtual machines, or a share on a file server. Each machine gives the path as it sees it, for example /Users/me/WingMail on the host and Z:\WingMail on a Windows virtual machine.
  • A sync folder -- A folder kept in sync by Dropbox, OneDrive, iCloud Drive, Google Drive, or Syncthing. Messages arrive only as fast as the service syncs them. The service's provider can see peer names and when each peer is active, but can't read the tasks and changes.
  • A directory on an ssh host -- A directory on one of your Remote Hosts, which may be one of the peers or another machine. New... sets up a host. The path is on that host, either full or relative to the home directory there.

An ssh mailroom logs in as remote development does, with a key loaded into ssh-agent or a password or passphrase entered once in the Wing session. A machine that receives tasks with no one at it, such as a virtual machine after a restart, needs to log in without a prompt: load its key into ssh-agent at login, or give it a key with no passphrase that is authorized only on the mailroom's host. See Setting up SSH for Remote Development for details.

Who Can Send Tasks

Tasks from peers run with the receiving machine's agents and permissions, so keep the mailroom reachable only by your own machines, for example a folder shared only with your own virtual machines, or a directory on an ssh host that only you log into. Wing encrypts each message with the mailroom key, and a machine declines every message not encrypted with its key.

When two machines have different keys, or one has none, they decline each other's tasks, and the Send to Peer window says so. To fix it, copy one machine's setup or key to the other. To remove a machine from the group, generate a new key and paste it on each machine that stays.

Peers on Older Wings

Peers running older versions of Wing 12 work with this one, but an older Wing's Peers... dialog can't paste a copied setup, and shows That is not a mailroom key. To set up an older Wing, select Copy Key Only (for Older Wings) from the Copy drop-down menu here. Then, in the older Wing, choose the same mailroom by hand and press Paste. A key copied from an older Wing pastes here as a key alone.

See Trust Peer Machines in AI Agent Safety for what a peer's task can and can't do on the receiving machine.