Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

fix(switchdash): stop offering sign-in on a server that cannot be reached (CHOO-2042)

Louis Amaudruz5564b901f255
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8b93c23c1..c20645ff6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -318,6 +318,12 @@ version of their own to them without also giving them a release of their own.
it would never receive. There is nothing to sign into while the gateway is
down, so the sign-in form no longer appears at all. The underlying error goes
to the console (CHOO-2042).
+- The sidebar no longer offers "Sign in" on a server it cannot reach, which was
+ an action that could not work. Unreachable is now modelled apart from
+ signed-out, so the rooms list also stops reporting an unreachable server as
+ merely needing sign-in. A server whose data is unavailable shows a red dot
+ rather than amber, for both causes: neither is a transitional state
+ (CHOO-2042).
### [0.19.3] - 2026-08-09
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/ServersSidebarSection.tsx b/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/ServersSidebarSection.tsx
index c48ad2f8c..f8552dd08 100644
--- a/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/ServersSidebarSection.tsx
+++ b/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/ServersSidebarSection.tsx
@@ -260,7 +260,10 @@ const ServerEntry = observer(function ServerEntry({ serverId }: { serverId: stri
aria-hidden
className={cn(
'size-1.5 shrink-0 rounded-full',
- dormant ? 'bg-foreground-muted' : connected ? 'bg-green-500' : 'bg-amber-500'
+ // Amber reads as "warming up". Neither signed-out nor
+ // unreachable is transitional: both mean this server's data
+ // is unavailable right now, so both are red.
+ dormant ? 'bg-foreground-muted' : connected ? 'bg-green-500' : 'bg-red-500'
)}
/>
{drift && <ServerDriftIndicator drift={drift} />}
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/server-availability.test.ts b/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/server-availability.test.ts
new file mode 100644
index 000000000..707f66dbf
--- /dev/null
+++ b/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/server-availability.test.ts
@@ -0,0 +1,64 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+const serversStore = vi.hoisted(() => ({
+ servers: [] as { id: string; managed?: boolean; managementKind?: string; sshHost?: string }[],
+ connected: new Set<string>(),
+ unreachable: new Set<string>(),
+ isConnected(serverId: string): boolean {
+ return this.connected.has(serverId);
+ },
+ isUnreachable(serverId: string): boolean {
+ return this.unreachable.has(serverId);
+ },
+}));
+
+const localStore = vi.hoisted(() => ({ isRunning: true }));
+
+vi.mock('./switch-servers-store', () => ({ switchServersStore: serversStore }));
+vi.mock('./local-server-store', () => ({ localServerStore: localStore }));
+vi.mock('./remote-server-store', () => ({ remoteServerStore: { isRunning: () => true } }));
+
+const { serverAvailability } = await import('./server-availability');
+
+beforeEach(() => {
+ serversStore.servers = [{ id: 'srv-a' }];
+ serversStore.connected.clear();
+ serversStore.unreachable.clear();
+ localStore.isRunning = true;
+});
+
+describe('why a server is unavailable', () => {
+ it('reads as available when signed in', () => {
+ serversStore.connected.add('srv-a');
+
+ expect(serverAvailability('srv-a')).toBe('available');
+ });
+
+ it('reads as signed-out when it answers but nobody is signed in', () => {
+ expect(serverAvailability('srv-a')).toBe('signed-out');
+ });
+
+ it('reads as unreachable rather than signed-out when it does not answer', () => {
+ // These are not the same problem. Signed-out is fixed by the user signing
+ // in; unreachable cannot be, so the sidebar must not offer "Sign in" for it.
+ serversStore.unreachable.add('srv-a');
+
+ expect(serverAvailability('srv-a')).toBe('unreachable');
+ });
+
+ it('prefers a live connection over a stale unreachable flag', () => {
+ serversStore.connected.add('srv-a');
+ serversStore.unreachable.add('srv-a');
+
+ expect(serverAvailability('srv-a')).toBe('available');
+ });
+
+ it('reads a stopped managed stack as dormant, not unreachable', () => {
+ // Nothing is wrong with a stack the user has not started.
+ serversStore.servers = [{ id: 'srv-a', managed: true, managementKind: 'local' }];
+ serversStore.unreachable.add('srv-a');
+ localStore.isRunning = false;
+
+ expect(serverAvailability('srv-a')).toBe('dormant');
+ });
+});
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/server-availability.ts b/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/server-availability.ts
index 7846c82cc..4ac120f08 100644
--- a/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/server-availability.ts
+++ b/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/server-availability.ts
@@ -8,10 +8,13 @@ import { switchServersStore } from './switch-servers-store';
* - `available` — signed in; its rooms and agents can be read.
* - `signed-out` — reachable but not signed in. Nothing can be read until the
* user signs in, so retrying is pointless; the fix is an action they take.
+ * - `unreachable` — the gateway did not answer. A fault rather than a prompt:
+ * signing in is impossible while it is down, so offering it would be an
+ * action that cannot work.
* - `dormant` — a managed stack that is not running. There is no gateway to
* sign in to yet, so this is not a sign-in prompt either.
*/
-export type ServerAvailability = 'available' | 'signed-out' | 'dormant';
+export type ServerAvailability = 'available' | 'signed-out' | 'unreachable' | 'dormant';
/**
* A managed server that is not running has no gateway to reach, so it cannot be
@@ -29,5 +32,6 @@ export function serverAvailability(serverId: string): ServerAvailability {
? remoteServerStore.isRunning(server.sshHost)
: localServerStore.isRunning;
if (server.managed && !managedRunning) return 'dormant';
- return switchServersStore.isConnected(serverId) ? 'available' : 'signed-out';
+ if (switchServersStore.isConnected(serverId)) return 'available';
+ return switchServersStore.isUnreachable(serverId) ? 'unreachable' : 'signed-out';
}
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/switch-rooms-store.test.ts b/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/switch-rooms-store.test.ts
index 8f6a49dc1..977fa7073 100644
--- a/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/switch-rooms-store.test.ts
+++ b/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/switch-rooms-store.test.ts
@@ -7,6 +7,8 @@ const serversStore = vi.hoisted(() => ({
servers: [] as { id: string; name?: string; managed?: boolean }[],
activeServerId: null as string | null,
isConnected: (_serverId: string): boolean => true,
+ // These servers answer; they are simply not signed in to.
+ isUnreachable: (_serverId: string): boolean => false,
statusFor: (serverId: string) => ({ user: { id: `user-of-${serverId}` } }),
}));
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/view.tsx b/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/view.tsx
index 2da0f99ba..7c3d4d3f0 100644
--- a/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/view.tsx
+++ b/dash/apps/switchdash-desktop/src/renderer/features/switch-servers/view.tsx
@@ -323,7 +323,7 @@ function StatusDot({ connected }: { connected: boolean }) {
return (
<span
aria-hidden
- className={`inline-block size-2 rounded-full ${connected ? 'bg-green-500' : 'bg-amber-500'}`}
+ className={`inline-block size-2 rounded-full ${connected ? 'bg-green-500' : 'bg-red-500'}`}
/>
);
}