Repository navigation
Description
Problem
Settings → Connections offers two ways to connect two machines: upstream's Linked environments (an agent here acts on another machine) and J5's Peer servers (agents on the two machines message each other). A person can't tell which one they need, and nobody has found a reason to want one without the other. Starting a Peer Agent on another machine (#956) needs both, set up in two places, with different directions, lifetimes and removal behaviour.
The split is a fact about who owns the code. It shouldn't be visible to users.
Decisions (Jackson, 2026-11-09)
Made in the thread "Peering vs linking: where to draw the line". The comparison that led here is #925, in the artifact planning/linking-vs-peering-ux.md.
- One feature for users. Peering and links stay separate in the code. Users see one thing, called a link.
- J5 takes over upstream's link UI on web and desktop. This changes upstream's product, so it needs a new entry in the register of divergences (
docs/j5/product/upstream.md). The reason is J5's own: J5 has peering, and users shouldn't see two ways to do one job. Underneath, a link still creates upstream's link and J5's peer record. - Add environment stays upstream's. When it succeeds, and the person is an Owner on the new machine and on at least one other J5 machine, J5 offers the link flow straight after, with the new machine already picked. It can be skipped, and the same flow is reachable from Settings.
- No pasted pairing code in the link flow (Compare the setup UX of linked environments and peering #925's first idea). A machine that isn't in the browser is added the normal way first.
- The flow is choose, check, then link.
- A checklist of the person's other machines.
- Two levels, one per direction ("agents on Laptop may, on these machines" and "agents on these machines may, on Laptop"), chosen once for every ticked machine, with a per-machine override on its row.
- The reachability check runs for every ticked pair together. A pair the check settled needs nothing more. A pair with a problem gets a button on its own row.
- Link does every ticked pair. A pair that fails shows its error and the others still link.
- Levels: Messages only, then upstream's five (Read only, Supervised, Auto-accept edits, Auto, Full access). Both dropdowns start on Supervised, as upstream's does. The picker says what Full access adds: it is needed to start Peer Agents on the other machine and to act on that machine's own threads.
- The Labs switch. Picking a level above Messages only turns on Linked environments on the machines involved, and the screen says so. Upstream's default stays off for anyone who never links machines.
- Expiry. Upstream's link lasts 30 days. The pair's row shows when its actions expire and has a Renew button that covers both directions. An agent's link request card renews it from the thread. J5 does not renew automatically.
- Remove. One Remove ends the whole link on both machines: the peer records, the links in both directions and the link sessions. The confirmation says what is lost (messages and Exchanges still waiting, and delegated tasks on the other machine that stop being followed). A browser that manages only one side warns as peering does today. Setting a direction to Messages only drops that direction's actions and keeps messaging.
- The agent's request card keeps upstream's shape (reason, machine, level, approve) and
t3_environment_linkkeeps its name. Approving it sets up messaging plus the one direction the agent asked for; the other direction stays on Messages only. The check result shows before approval. "Another address…" is replaced by "Add it to this browser first". On a pair that is already linked, the card raises that direction's level or renews an expired link. - Mobile is parked. Mobile keeps upstream's link card and link list as shipped. A link approved there has no messaging, so the web row needs a state that reads "Actions work. Messaging isn't set up", with a Set up messaging button where the other machine runs J5. The same state covers links made before this ships and a T3 Code machine that isn't J5.
- Words. Settings has one section, "Linked environments", with one row per pair. "Peer servers" and "Add peer" leave the UI. "Peering" stays the internal name for the message path, in the spec and the code.
- Sequence. After Reverse route: let the VM reach a laptop that can't be reached, over a line the laptop opens #951 (reverse route) and before j5_spawn_agent starts a Peer Agent on another J5 machine (environment_id) #956 and Delegate a persona to another J5 machine #957.
To settle in the definition
Not decided yet; the definition should propose an answer for each.
- What the check offers when a machine can't be reached. After Reverse route: let the VM reach a laptop that can't be reached, over a line the laptop opens #951 the fix is the laptop's line to the other machine. The check and its Fix button need designing with Reverse route: let the VM reach a laptop that can't be reached, over a line the laptop opens #951.
- The
j5 environmentCLI. Like mobile, it creates upstream's link with no messaging. Say whether it stays as upstream ships it and lands in the "Messaging isn't set up" state. - Existing peers and links. How pairs that are already peered, already linked, or both appear as rows on the first run.
- The route for messages. Today a pair's direct or poll choice changes only by removing the peer and peering again. Say whether that carries over unchanged.
- Model-facing text.
t3_environment_link's description, the card's wording and the link errors agents read all say what a link is. Check each against the new meaning, and live-test any change with Haiku or Luna. One known case: a call over a line fails withpeer_unreachableand upstream's message " did not answer at http://127.77.x.y:1.", which shows the line's address, though nothing else ever shows it. Seen in the ZPA hand test on Reverse route: let the VM reach a laptop that can't be reached, over a line the laptop opens #951. Say the machine didn't answer, without the address.
How to do it
- Rewrite the definition first: the Peering and "Starting work on another machine" sections of
docs/j5/product/cross-device.md, a new register entry, the peering and linking paragraph indocs/j5/product/upstream-convergence.md, and a short section in J5's user docs on what a link does in J5 (upstream's guides describe one direction and actions only). Jackson reads docs and UI before a build starts. - Build on web and desktop. Upstream-owned files it reaches include
apps/web/src/components/settings/AddEnvironmentDialog.tsx(one hook where it finishes),LinkedEnvironmentsSettings.tsx,LinkAccessPicker.tsxand the link request card; J5's side isapps/web/src/j5/peering/. Record every upstream edit inFORK.md. - Live-test between two J5 test servers (
setup-agent-live-test.ts --peer), including an agent's card, an expired link, Remove from a browser that manages one side, and a link made on mobile showing as "Messaging isn't set up" on web. Before and after captures for every state.
Related
#925 (the comparison; closed by this), #951 (reverse route), #956 and #957 (Peer Agents and persona delegates on another machine), #953 (Crews across machines), #772 (linked environments in the v0.1.7 advance).
Claude Fable 5.2
Activity
Jacksondr5 commentedon Nov 20, 2026
The definition is in #1098 (Jackson's LGTM, 2026-11-19):
cross-device.md"Environment links", AC36–AC48, and register entry D47. Build against those.Settled there, from this issue's "To settle in the definition" list:
j5 environment linkandj5 a2a peer.For the build's docs: the user-guide section is on the branch
docs/unified-link-user-guide, held back because it describes screens that don't exist yet.docs/j5/user/j5-peering.mdneeds its rewrite with the build too. Linking from mobile is #1097.Claude Fable 5.2
docs(j5): one link connects two servers, for messages and actions (#1098
Jacksondr5 commentedon Nov 20, 2026
Build design, agreed with Jackson on 2026-11-19 from sketches in the build thread. Words a person reads say tools where the definition says actions, and a direction with none reads Off (the definition's Messages only).
Rulings that change the definition
linkedand no card is raised. The card links a new pair and renews an expired one; levels change only on the pair's row. AC45's "the card raises that direction's level" is reworded with the build.Settings section. Title "Linked environments", tag line "Link two of your servers so their agents can message each other and use tools on the other server."
Pair row. A Messages line (how they travel) and a Tools block with one picker for each direction, reading "Home's agents on Work". Levels: Off, then upstream's five. Under them, when tool access runs out. Renew is a button only in the last 5 days and after expiry, and sits in the ••• menu before that with Edit address and Remove. A pair with tools off both ways has a hint line saying to choose a level. A pair with upstream's link and no peering shows only the direction that exists, with Set up messaging; for a T3 Code server it says messaging needs J5 Code there.
Link dialog. One screen, not a wizard. "How does this work?" is in the dialog's tag line. "Link [server] with", a checklist of the other servers, and two Tools pickers that apply to every ticked server. Each ticked server has one line saying how messages will travel, with Change. The dialog asks nothing: it takes the safe route and Change overrules it. Change opens that server's line in place with the ways messages can travel, one marked Recommended ("Sent directly both ways · both always on and reachable"), and a Tools block for that pair's own levels. A server that cannot be linked stays listed, greyed, with the reason. One note names the servers Linked environments is turned on for. After Link, one result line for each pair; a direction whose tools could not be made is left Off with the reason.
Changing a pair. A level change applies at once. It asks first only when it has to turn on Linked environments, and names the servers. Setting a direction to Off asks nothing. A change that fails leaves the direction as it was, with the reason under it. Renew covers every direction that has tools. Remove keeps the three confirmations (both servers, the other already ended it, here only) with the tools consequences added. A server this app cannot manage has its picker disabled with the reason.
Agent's card. The card in the thread is upstream's, unchanged. J5 owns the dialog behind it: the link dialog's server line and one Tools picker, for the direction the agent asked for; the other direction is shown and not editable. "Another address…" goes: a server that is not in the app is named, with adding it as the step to take.
After Add environment. The link dialog opens by itself once the new server has connected, with that server fixed (no dropdown), every other manageable server ticked, and "Not now" in place of Cancel. No offer for an added route, or for a server this app cannot manage.
Explainer page.
j5.codes/peeringmoves to/linking, with/peeringredirecting, and is rewritten around a link.Build shape. Four layers: the server's link-session service and the unreachable text without the line's address; the Settings section and row; the link dialog, the offer and the card's dialog; then one docs PR.
Claude Fable 5.2
fix(web): what a visual review of the link screens found
docs(j5): the link definition says what the screens show
fix(j5): what the review bot found in the link stack
fix(web): J5 Code's name on the Linked environments confirmation, and…
Jacksondr5 commentedon Nov 21, 2026
Upstream v0.1.11 changes two decisions here (2026-11-21)
Decision 5 (choose, check, then link). Upstream shipped batch linking in pingdotgg/t3code#39426. Settings → Linked environments has Link several… once the app has two other saved machines: a checklist of them, one access level, one confirm. For each ticked machine it mints a one-use pairing code there and makes an ordinary single link, with no batch RPC. A machine can't be selected, and shows why, when it's already linked, the app isn't connected to it, the session lacks
access:write, or the app has no address another machine can reach. The CLI gainedt3 environment link --from <file>.The definition should build J5's flow on this rather than design its own checklist. Two things are still J5's to add:
Decision 8 (expiry). In pingdotgg/t3code#39399, links now renew while they're used. The receiving side moves its session's expiry 30 days out at most once a day, and the linking side stores the
T3-Link-Expires-Atheader that comes back. "Upstream's link lasts 30 days", the Renew button and "J5 does not renew automatically" no longer match upstream. A link expires only after 30 days unused, or one side runs an older version. Follow upstream: drop J5's own renewal, and keep only what upstream shows for an expired link.Claude Opus 5.5
feat(server): a link's session on the other server can be found and e…
feat(web): Settings lists links in one section, one row for each pair (…
feat(web): one dialog links servers, after adding one and from an age…
docs(j5): a link as built, in the definition, the guides and the site (…