Skip to content

Commit 5d41296

Browse files
t3dotggclaude
andcommitted
fix(web): a disconnected publish-only machine asks to reconnect
T3 Connect refuses to health-check links it does not manage, so that failure no longer shows a Check again that can never pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3e4ed7d commit 5d41296

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎apps/web/src/components/mcp/mcpGate.test.ts‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,25 @@ describe("resolveMcpGate", () => {
5858
// A disconnected saved machine follows T3 Connect's list. Offline or an unreadable list keeps
5959
// a retry; only a list showing nothing wrong asks to reconnect.
6060
const away = { ...saved, connected: false };
61-
const listed = (availability: "online" | "offline" | "error") => ({
61+
const listed = (
62+
availability: "checking" | "online" | "offline" | "error",
63+
providerKind: "cloudflare_tunnel" | "manual" = "cloudflare_tunnel",
64+
) => ({
6265
...away,
63-
relay: { ...saved.relay, availability },
66+
relay: {
67+
status: "listed",
68+
endpoint: { ...savedTunnel, providerKind },
69+
availability,
70+
} as const,
6471
});
72+
expect(resolveMcpGate(listed("checking")).kind).toBe("checking");
6573
expect(resolveMcpGate(listed("offline"))).toEqual({ kind: "disconnected", relay: "offline" });
6674
expect(resolveMcpGate(listed("error"))).toEqual({ kind: "disconnected", relay: "failed" });
75+
// T3 Connect refuses to check a publish-only link, so that failure says nothing.
76+
expect(resolveMcpGate(listed("error", "manual"))).toEqual({
77+
kind: "disconnected",
78+
relay: null,
79+
});
6780
expect(resolveMcpGate({ ...away, relay: { status: "failed" } })).toEqual({
6881
kind: "disconnected",
6982
relay: "failed",

‎apps/web/src/components/mcp/mcpGate.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ export function resolveMcpGate(input: {
5555
const { relay } = input;
5656
if (!input.connected) {
5757
if (input.thisMachine) return { kind: "disconnected", relay: null };
58-
const availability = relay.status === "listed" ? relay.availability : undefined;
58+
// T3 Connect checks only its own tunnels; a publish-only link's check always fails.
59+
const availability =
60+
relay.status === "listed" && relay.endpoint?.providerKind === "cloudflare_tunnel"
61+
? relay.availability
62+
: undefined;
5963
// A refresh empties the list first, so wait for it instead of flashing "Connect first".
6064
if (relay.status === "loading" || availability === "checking") return { kind: "checking" };
6165
if (relay.status === "failed" || availability === "error") {

0 commit comments

Comments
 (0)