From 5e488d0fc2504f3ad843ca13dda5055535db0e29 Mon Sep 17 00:00:00 2001 From: Alexgodoroja Date: Wed, 16 Sep 2026 00:32:52 -0700 Subject: [PATCH] Point the unreachable-relay advice at the next session, not this app A session on a relay this app does not proxy to was turned away with "Start it with SHELL_ONLINE_SERVER= to open it here." Two things were wrong with that sentence. The subject was the app. It follows "this app proxies to ", so "start it" reads as the app, and SHELL_ONLINE_SERVER is not the app's variable -- that is the CLI's. The app reads VITE_RELAY_URL, so setting the named variable here changes nothing. And it promised something it cannot deliver. The session being turned away has usually already finished; starting anything opens a new session and never recovers this one. Its screen only ever existed on the relay that recorded it. So say where the screen is, and offer the setting for the next session rather than as a way back into this one. Co-Authored-By: Claude Opus 5 (1M context) --- app/src/terminal/socket-url.test.ts | 21 +++++++++++++++++++++ app/src/terminal/socket-url.ts | 5 +++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/src/terminal/socket-url.test.ts b/app/src/terminal/socket-url.test.ts index 0cdb393..d577ad0 100644 --- a/app/src/terminal/socket-url.test.ts +++ b/app/src/terminal/socket-url.test.ts @@ -84,6 +84,27 @@ describe("a session on a relay the app cannot reach", () => { } }); + it("offers the relay setting for the next session, not as a way back into this one", () => { + /* + * SHELL_ONLINE_SERVER belongs to the CLI that starts a session, not to + * this app, which reads VITE_RELAY_URL. Told to "start it" in a sentence + * whose subject was the app, people set the variable here and nothing + * changed -- and a session that has already finished cannot be reopened + * by starting anything. The advice is about the next session. + */ + const result = resolveSessionSocket( + `https://shell.online/s/${ID}`, + "http://localhost:5173", + RELAY, + ); + expect(result.ok).toBe(false); + if (!result.ok) { + expect(result.reason).not.toContain("Start it with"); + expect(result.reason).not.toContain("to open it here"); + expect(result.reason).toContain("A session started with"); + } + }); + it("explains when no relay is configured at all", () => { const result = resolveSessionSocket( `https://shell.online/s/${ID}`, diff --git a/app/src/terminal/socket-url.ts b/app/src/terminal/socket-url.ts index c31e52b..e85613f 100644 --- a/app/src/terminal/socket-url.ts +++ b/app/src/terminal/socket-url.ts @@ -76,8 +76,9 @@ export function resolveSessionSocket( return { ok: false, reason: - `This session is on ${share.origin}, but this app proxies to ${relay.origin}. ` + - `Start it with SHELL_ONLINE_SERVER=${relay.origin} to open it here.`, + `This session is on ${share.origin}, but this app reaches ${relay.origin}, ` + + `so its screen is only available where it was started. ` + + `A session started with SHELL_ONLINE_SERVER=${relay.origin} opens here.`, }; }