Each connection joins a client to one environment over HTTP and WebSocket. Direct access, Tailscale, SSH, and T3 Connect change how the client reaches the server; they do not introduce a different execution model.
- An environment keeps its ID across restarts and endpoint changes. Repository identity can
correlate clones across environments (preferring
upstreamfor PR features, grouping forks byorigin), but work never silently crosses environments. - Environment ID initialization publishes atomically and retains repair state so concurrent initializers choose the same winner; do not sweep that recovery state as temp cleanup.
- Routes are untrusted hints. Only the connecting client can prove reachability. Never fall back to loopback when a shareable endpoint is unavailable (loopback names the client's own machine). Verify a direct or learned route answers as the expected environment before sending credentials, and never let a token paired over HTTPS downgrade to plain HTTP.
- Pull request routing trust covers the saved route set: adding or changing a route revokes trust; reordering does not.
A peer link lets one environment's agents work in another
by signing in to the target's /mcp as an ordinary OAuth client (t3code-peer-link). The receiving
side lists and revokes it in Sharing & access like any other session, and owns its expiry/renewal.
- Mode ceilings always narrow. Forwarded calls carry the calling agent's modes in
T3-Mode-Limit, which the receiving/mcpcan only intersect downward with the link's approved access. - Non-full-access links are fenced by
linkOrigin. Threads launched by a peer link (and their derived forks, subagents, and spawned threads) carry an immutablelinkOriginstamp enforced in shared access rules (mcp/linkOrigin.ts). Below full access, linked work can mutate only threads with the same origin, cannot touch projects, settings, scheduled tasks, or further links, and skips project setup scripts and worktree layout commands (in a project that declares a layout, a worktree launch or handoff for such a thread fails; restoring a missing folder brings back plain checkouts). Full-access links are not fenced because their agents already run as the receiving OS user. - Namespace idempotency keys. All callers on the linking side share one session on the receiving side, so idempotency keys must be hashed with the caller's namespace before forwarding.
- Clients read linked threads as standard thread streams.
PeerThreadRelayproxies the same stream format read-only so there is no second transcript schema to maintain.
The hosted web app stores its connection catalog in the browser and connects directly to each environment without proxying traffic. A hosted pairing URL puts the backend target in the query and the pairing secret in the URL fragment so the secret never reaches the hosted origin, then strips it from history.
A desktop webview for a remote environment keeps localhost URLs and tunnels loopback connections
through /api/preview/tunnel on the environment's own origin:
- Fixed SOCKS5 proxy, not PAC. Chromium ignores PAC scripts for loopback hosts. Use a fixed proxy that routes only loopback through the tunnel (excluding link-local addresses) and never falls back directly—a failed or disabled tunnel must error rather than silently load the reviewer's own localhost.
- Media tickets and local-owner check. Desktop main holds no environment credentials, so the
renderer supplies a media ticket per connection (also tracking route switches). Because Chromium
cannot authenticate to SOCKS5 and a forwarded port is a plain local port, on Linux and macOS both
listeners serve only connections the system attributes to the current OS user (
/proc/net/tcpon Linux,lsofon macOS), and a connection whose owner cannot be read is refused. On Windows the listeners do not check the owner.
- Tailscale supplies an endpoint for normal pairing; auth remains the environment's responsibility.
- SSH cleanup stops a remote server only if the launcher started it; a server discovered already running must survive client disconnect.
- Remote servers outlive client releases. Clients negotiate features via advertised capabilities rather than assuming version parity. Process replacement uses the update protocol.