You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Linked environments: a pairing code created on this machine is sent to the other machine and fails as "unknown, expired, or already used" #30181
T3 Code Desktop 0.1.5 (stable) on a Mac (environment bcd6…). A headless server 0.1.5 on a Linux host on the tailnet (a3b7…, https://<host>.ts.net:3773).
Turn on Settings → Labs → Linked environments on the Mac.
A thread on the Mac posts a link request card for the Linux host (environment id given).
To get a code, open Settings → Sharing & access → Create link in the desktop app (the Mac's own settings, which is what the app shows) and paste it into the card right away.
Approve. Repeat with a second fresh code and a second card.
Expected behavior
Either the card tells me where to create the code (on the machine being linked, with a way to open that machine's Sharing & access), or, when I paste a code this machine issued itself, it says so: "This code was created on MacBook, not on frontlink-dev. Create the link on frontlink-dev."
Actual behavior
Every attempt fails with "That pairing code is unknown, expired, or already used." even though the code is seconds old and unused.
The logs show why. The Mac's auth_pairing_links has both codes (labels "Environments" at 13:22:01Z and "Linked Environments" at 13:24:49Z, neither consumed). The Linux server gets POST /oauth/mcp/register and POST /oauth/mcp/decision, and EnvironmentAuth.consumeMcpApprovalCode fails with ServerAuthMcpApprovalCodeError because the code is not in its own table (the UPDATE auth_pairing_links SET consumed_at matches no row). The Mac reports PeerLinks.signIn → PeerLinkError: That pairing code is unknown, expired, or already used. three times (13:22:34Z, 13:22:42Z, 13:25:18Z).
The error suggests a timing problem, so I retried quickly several times; the real problem was which machine made the code.
Impact
Linking another machine looks broken. With nothing pointing at the cause, it is easy to give up on the feature.
Version or commit
Desktop 0.1.5 (stable, "T3 Code (Beta).app"), server 0.1.5 on Linux (systemd service). The latest stable is 0.1.6; I found no change about this in its notes.
Environment
macOS (arm64) desktop, Linux x64 headless server, both on Tailscale, T3 Connect on.
Notes
Related, not the same: #30088 (the same error message for an MCP sign-in, closed as a code from another server; the same trap, which suggests the message itself should name the cause), #27688 (Linked environments points to the wrong settings page), #26952 (the link card can't be dismissed).
One more data point: I switched the desktop app to the Linux environment before opening Settings → Sharing & access → Create link, and the code was still created on the Mac (the Mac's auth_pairing_links has it at 13:38:40Z; the Linux server's newest pairing link is from 12:20Z, a T3 Connect one). So from the desktop app there seems to be no way to create a link on the machine you want to link, and the card fails the same way each time.
What finally worked: a code created on the Linux host itself (t3 auth pairing create there), pasted into the card as the bare code. Pasting the full https://…/pair#token=… link from that same command into the card failed with the same "unknown, expired, or already used" message, so the card could also accept the link form, or at least say it wants the bare code.
Activity
daan-nijhuis commentedon Nov 3, 2026
One more data point: I switched the desktop app to the Linux environment before opening Settings → Sharing & access → Create link, and the code was still created on the Mac (the Mac's
auth_pairing_linkshas it at 13:38:40Z; the Linux server's newest pairing link is from 12:20Z, a T3 Connect one). So from the desktop app there seems to be no way to create a link on the machine you want to link, and the card fails the same way each time.daan-nijhuis commentedon Nov 3, 2026
What finally worked: a code created on the Linux host itself (
t3 auth pairing createthere), pasted into the card as the bare code. Pasting the fullhttps://…/pair#token=…link from that same command into the card failed with the same "unknown, expired, or already used" message, so the card could also accept the link form, or at least say it wants the bare code.