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: the thread relay and client pairing still keep a link the peer revoked #977
What is left:#964 ends a link here once the peer turns its token away, but only for calls through PeerMcpClient (every agent tool call). Two other paths still only record the refusal, so the link keeps listing as reachable there:
Thread-stream relay:apps/server/src/peer/PeerThreadRelay.ts (around line 109) maps both 401 and 403 to a rejected read error ("Its link may have been revoked there; link it again.") and does not end the link. A user who only reads linked threads keeps seeing the link as live.
Client pairing:apps/server/src/peer/PeerClientPairing.ts (ask) turns every refusal of clientPairing, a 401 included, into unsupported("refused") and does not end the link.
Expected: both end the link the same way PeerMcpClient now does (fork/peerLinkRevoke.ts):
Only a 401 can end a link. A 403 (linked_environments_off, not_a_link_session, a browser origin) must not.
A single 401 is not proof. End the link only when a fresh MCP session started right after it is refused with 401 too, because an older peer answers 401 for its own storage errors as well. Since fix(server): a link the peer revoked ends here too #964 a current peer answers 503 for those, on /mcp and on the linked-thread routes.
Use PeerLinks.recordRevoked with the linked_at the refused request resolved, so a link made again since is kept.
Also to weigh: a different machine answering at the link's stored address as the same environmentId (a reused address on the LAN or tailnet, say) can answer 401 and end the link. resolve already sends that address the token, so this adds little, and a new pairing code recovers. Still, the fix should not make it easier. For example, keep the fresh-session check above, which that machine would also have to refuse.
Test: for the relay and for client pairing, the box revokes the link, then a stream read (or a pairing request) ends the link here and the link lists as expired. A 403 and a single 401 followed by an accepted fresh session leave the link reachable.
apps/server/src/fork/peerLinkRevoke.ts:17 keeps its own copy of the protocol version string from PeerMcpClient.ts:26; pass it in through makeRefusals' inputs (no new seam line).
peerLinkRevoke.ts:111: a 403 on the second session start gives a generic "HTTP 403" message instead of the "Linked environments turned off" one (link is kept, text only).
PeerMcpClient.ts:176-179: the old 401 branches can no longer be reached (upstream code; leave unless the seam count allows).
peer/linkThreadHttp.ts:74: a store failure at the 30 s recheck of an open thread stream now ends the stream with an error instead of cleanly (relay reconnects; only a log error).
Older peer with a longer outage: an older peer still answers 401 for its own storage errors and can end a good link if the outage outlasts the 2-3 back-to-back checks (peerLinkRevoke.ts:84, no wait between them). Consider a short wait between them.
PeerMcpClient.ts:250: if the fresh session is accepted but the retried call gets 401 again, the message says "revoked there; link it again" although the link still works.
Activity
scuttletoby commentedon Nov 22, 2026
Minor follow-ups from the round-2 lenses on #964 (both safe to merge): code #964 (comment), state #964 (comment)
apps/server/src/fork/peerLinkRevoke.ts:17keeps its own copy of the protocol version string fromPeerMcpClient.ts:26; pass it in throughmakeRefusals' inputs (no new seam line).peerLinkRevoke.ts:111: a 403 on the second session start gives a generic "HTTP 403" message instead of the "Linked environments turned off" one (link is kept, text only).PeerMcpClient.ts:176-179: the old 401 branches can no longer be reached (upstream code; leave unless the seam count allows).peer/linkThreadHttp.ts:74: a store failure at the 30 s recheck of an open thread stream now ends the stream with an error instead of cleanly (relay reconnects; only a log error).peerLinkRevoke.ts:84, no wait between them). Consider a short wait between them.PeerMcpClient.ts:250: if the fresh session is accepted but the retried call gets 401 again, the message says "revoked there; link it again" although the link still works.🤖 Generated with Claude Code
fork-seams: announce #1007 linked-revoke seam lines (#1009)
fix(#977): round 1: the probe ends its session however it stops, and …
fix(#977): the thread relay and client pairing end a link the peer re…
fork-seams: announce #1007 linked-revoke seam lines (#1009)
fix(#977): the thread relay and client pairing end a link the peer re…
fork-seams: announce #1007 linked-revoke seam lines (#1009)
fix(#977): the thread relay and client pairing end a link the peer re…