Skip to content

The agent that grows with you

fix(desktop): give the Tailscale interactive-auth SSH probe class its own UI copy

Brooklyn Nicholson71ddc56792ea
diff --git a/apps/desktop/electron/windows-remote-lifecycle.test.ts b/apps/desktop/electron/windows-remote-lifecycle.test.ts
index 37fa2d4c7c2..0e482fdb185 100644
--- a/apps/desktop/electron/windows-remote-lifecycle.test.ts
+++ b/apps/desktop/electron/windows-remote-lifecycle.test.ts
@@ -277,12 +277,15 @@ test('platform detection surfaces transport failures as themselves, not unsuppor
})
test('platform detection preserves typed Windows probe failures', async () => {
- // `_fail()` (ssh-connection.ts) classifies exec deaths; the kinds that can
+ // `_fail()` (ssh-connection.ts) classifies exec deaths. The kinds that can
// reach this catch with a probe error are `unknown` (signal death / stderr
- // classification) and `superseded` (a newer connection attempt took over).
- // Either must surface as itself — an operational failure — never as the
- // "unsupported operating system" verdict.
- for (const kind of ['unknown', 'superseded'] as const) {
+ // classification) and `interactive-auth` (the Tailscale browser check
+ // classifying a non-zero exec); the four TRANSPORT_KINDS are rethrown above.
+ // `superseded` cannot reach it today — `exec()` passes no AbortSignal — but
+ // it is pinned too: if a caller ever threads a signal through, the sentinel
+ // must still surface as itself, never as the "unsupported operating system"
+ // verdict.
+ for (const kind of ['unknown', 'interactive-auth', 'superseded'] as const) {
const probeErr: any = new Error('PowerShell remote command failed with exit code 1')
probeErr.kind = kind
diff --git a/apps/desktop/src/app/settings/gateway-settings.test.tsx b/apps/desktop/src/app/settings/gateway-settings.test.tsx
index 187c786b708..9bc9ff12f83 100644
--- a/apps/desktop/src/app/settings/gateway-settings.test.tsx
+++ b/apps/desktop/src/app/settings/gateway-settings.test.tsx
@@ -2,6 +2,7 @@ import { GatewayReauthRequiredError } from '@hermes/shared'
import { act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'
+import { $notifications } from '@/store/notifications'
import { deferred } from '@/test/deferred'
// Collect the component graph before the behavioral test deadline starts.
@@ -537,6 +538,40 @@ describe('GatewaySettings', () => {
})
})
+ it('surfaces the Tailscale browser-check guidance for an interactive-auth SSH test failure', async () => {
+ getConnectionConfig.mockResolvedValue({
+ ...localConnection,
+ mode: 'ssh',
+ sshHost: 'build-box',
+ sshUser: '',
+ sshPort: 22,
+ sshKeyPath: '',
+ sshRemoteHermesPath: '',
+ sshRemoteProfile: ''
+ })
+ const testConnectionConfig = vi.fn().mockResolvedValue({ reachable: false, sshError: 'interactive-auth' })
+ Object.assign(window.hermesDesktop, { testConnectionConfig })
+
+ render(<GatewaySettings />)
+ fireEvent.click(await screen.findByRole('button', { name: 'Test SSH' }))
+
+ // interactive-auth is the Tailscale browser-check class: the notification
+ // must carry the "run ssh <host> true" guidance, not the generic
+ // "SSH connection failed." fallback the table previously collapsed to.
+ try {
+ await waitFor(() =>
+ expect($notifications.get()).toEqual(
+ expect.arrayContaining([expect.objectContaining({ kind: 'error', message: expect.stringContaining('ssh <host> true') })])
+ )
+ )
+ expect(
+ $notifications.get().some((n: { message?: string }) => n.message === 'SSH connection failed.')
+ ).toBe(false)
+ } finally {
+ $notifications.set([])
+ }
+ })
+
it('opens a focused, typeable custom SSH host input on the first "Custom" selection', async () => {
getConnectionConfig.mockResolvedValue({
...localConnection,
diff --git a/apps/desktop/src/app/settings/gateway-settings.tsx b/apps/desktop/src/app/settings/gateway-settings.tsx
index e8684806578..9f94ebede04 100644
--- a/apps/desktop/src/app/settings/gateway-settings.tsx
+++ b/apps/desktop/src/app/settings/gateway-settings.tsx
@@ -605,6 +605,7 @@ function GatewayConnectionSettings({ embedded, standalone }: { embedded: boolean
'auth-failed': g.sshErrAuth,
'hermes-not-found': g.sshErrNotInstalled,
'host-key-changed': g.sshErrHostKey,
+ 'interactive-auth': g.sshErrInteractiveAuth,
timeout: g.sshErrTimeout,
unreachable: g.sshErrUnreachable,
'unsupported-platform': g.sshErrPlatform,
@@ -1013,6 +1014,7 @@ function GatewayConnectionSettings({ embedded, standalone }: { embedded: boolean
'auth-failed': g.sshErrAuth,
'hermes-not-found': g.sshErrNotInstalled,
'host-key-changed': g.sshErrHostKey,
+ 'interactive-auth': g.sshErrInteractiveAuth,
timeout: g.sshErrTimeout,
unreachable: g.sshErrUnreachable,
'unsupported-platform': g.sshErrPlatform,
diff --git a/apps/desktop/src/global.d.ts b/apps/desktop/src/global.d.ts
index 739fdf43c51..e0b63fe0346 100644
--- a/apps/desktop/src/global.d.ts
+++ b/apps/desktop/src/global.d.ts
@@ -1093,6 +1093,7 @@ export interface DesktopConnectionTestResult {
| 'auth-failed'
| 'hermes-not-found'
| 'host-key-changed'
+ | 'interactive-auth'
| 'timeout'
| 'unreachable'
| 'unsupported-platform'
diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.ts
index 4935c2be222..0ca14847d76 100644
--- a/apps/desktop/src/i18n/de.ts
+++ b/apps/desktop/src/i18n/de.ts
@@ -2016,6 +2016,8 @@ export const deOverrides = {
'Nicht unterstützte Remote-Plattform. Der Desktop-SSH-Modus von Hermes unterstützt Linux-, macOS- und Windows-Remote-Hosts.',
sshErrTimeout: 'SSH-Verbindung ist ausgelaufen. Der Host ist möglicherweise nicht erreichbar oder schläft.',
sshErrUpdateRequired: 'Aktualisieren Sie Hermes auf dem Remote-Host, bevor Sie sich mit Desktop-SSH verbinden.',
+ sshErrInteractiveAuth:
+ 'Tailscale SSH erfordert eine interaktive Browser-Prüfung. Führen Sie im Terminal `ssh <host> true` aus, schließen Sie die Prüfung ab und versuchen Sie es erneut – Hermes führt SSH nicht interaktiv aus.',
sshErrUnknown: 'SSH-Verbindung fehlgeschlagen.'
},
keys: {
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index f3278813f28..0e1b10608c2 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -1694,6 +1694,8 @@ export const en: Translations = {
'Unsupported remote platform. Hermes Desktop SSH mode supports Linux, macOS, and Windows remote hosts.',
sshErrTimeout: 'SSH connection timed out. The host may be unreachable or asleep.',
sshErrUpdateRequired: 'Update Hermes on the remote host before connecting with Desktop SSH.',
+ sshErrInteractiveAuth:
+ 'Tailscale SSH requires an interactive browser check. In Terminal, run `ssh <host> true`, complete the check, then retry — Hermes runs SSH non-interactively.',
sshErrUnknown: 'SSH connection failed.'
},
keys: {
diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.ts
index 05713001876..815e5d2e553 100644
--- a/apps/desktop/src/i18n/es.ts
+++ b/apps/desktop/src/i18n/es.ts
@@ -2009,6 +2009,8 @@ export const esOverrides = {
'Plataforma remota no compatible. El modo SSH de Hermes Desktop admite hosts remotos Linux, macOS y Windows.',
sshErrTimeout: 'La conexión SSH agotó el tiempo de espera. Es posible que el host no responda o esté en reposo.',
sshErrUpdateRequired: 'Actualiza Hermes en el host remoto antes de conectarte con Desktop SSH.',
+ sshErrInteractiveAuth:
+ 'Tailscale SSH requiere una comprobación interactiva del navegador. Ejecuta `ssh <host> true` en la terminal, completa la comprobación y vuelve a intentarlo; Hermes ejecuta SSH de forma no interactiva.',
sshErrUnknown: 'Falló la conexión SSH.'
},
keys: {
diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.ts
index 746edc3735a..99a298ac3d4 100644
--- a/apps/desktop/src/i18n/fr.ts
+++ b/apps/desktop/src/i18n/fr.ts
@@ -2021,6 +2021,8 @@ export const frOverrides = {
'Plateforme distante non prise en charge. Le mode SSH de Hermes Desktop supporte les hôtes distants Linux, macOS et Windows.',
sshErrTimeout: "Expiration de la connexion SSH. L'hôte peut être inaccessible ou en veille.",
sshErrUpdateRequired: "Mettez à jour Hermes sur l'hôte distant avant de vous connecter avec Desktop SSH.",
+ sshErrInteractiveAuth:
+ "Tailscale SSH exige une vérification interactive dans le navigateur. Exécutez `ssh <host> true` dans le terminal, terminez la vérification, puis réessayez — Hermes exécute SSH de façon non interactive.",
sshErrUnknown: 'Échec de la connexion SSH.'
},
keys: {
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index 09b9e254dd0..2c2c1c49f6b 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -1231,6 +1231,8 @@ export const ja = defineLocale({
'サポートされていないリモートプラットフォームです。Hermes Desktop の SSH モードは Linux、macOS、Windows のリモートホストに対応しています。',
sshErrTimeout: 'SSH 接続がタイムアウトしました。ホストが到達不能、またはスリープ中の可能性があります。',
sshErrUpdateRequired: 'Desktop SSH で接続する前に、リモートホストの Hermes を更新してください。',
+ sshErrInteractiveAuth:
+ 'Tailscale SSH では対話的なブラウザー確認が必要です。ターミナルで `ssh <host> true` を実行して確認を完了し、再試行してください。Hermes は SSH を非対話的に実行します。',
sshErrUnknown: 'SSH 接続に失敗しました。'
},
keys: {
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index 27d080fd858..1d4c7eed8b6 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -1348,6 +1348,8 @@ export const ru = defineLocale({
'Неподдерживаемая удалённая платформа. SSH-режим Hermes Desktop поддерживает удалённые хосты Linux, macOS и Windows.',
sshErrTimeout: 'SSH-соединение истекло. Хост может быть недоступен или «спит».',
sshErrUpdateRequired: 'Перед подключением через SSH обновите Hermes на удалённой машине.',
+ sshErrInteractiveAuth:
+ 'Tailscale SSH требует интерактивной проверки в браузере. Выполните `ssh <host> true` в терминале, завершите проверку и повторите попытку — Hermes запускает SSH неинтерактивно.',
sshErrUnknown: 'SSH-соединение не удалось.'
},
keys: {
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 4562c236327..3b82ae6c84d 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -1420,6 +1420,7 @@ export interface Translations {
sshErrPlatform: string
sshErrTimeout: string
sshErrUpdateRequired: string
+ sshErrInteractiveAuth: string
sshErrUnknown: string
}
keys: {
diff --git a/apps/desktop/src/i18n/zh-hant_settings.ts b/apps/desktop/src/i18n/zh-hant_settings.ts
index a58e426ec75..61ca0ffdf65 100644
--- a/apps/desktop/src/i18n/zh-hant_settings.ts
+++ b/apps/desktop/src/i18n/zh-hant_settings.ts
@@ -960,6 +960,8 @@ export const zhHantSettings = {
sshErrPlatform: '不支援的遠端平台。Hermes Desktop 的 SSH 模式支援 Linux、macOS 和 Windows 遠端主機。',
sshErrTimeout: 'SSH 連線逾時。主機可能無法存取或處於睡眠狀態。',
sshErrUpdateRequired: '使用 Desktop SSH 連線前,請更新遠端主機上的 Hermes。',
+ sshErrInteractiveAuth:
+ 'Tailscale SSH 需要互動式瀏覽器驗證。請在終端機執行 `ssh <host> true` 完成驗證後重試——Hermes 以非互動方式執行 SSH。',
sshErrUnknown: 'SSH 連線失敗。'
},
keys: {
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index e5698d08b50..411f6113d05 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -1624,6 +1624,8 @@ export const zh = defineLocale({
sshErrPlatform: '不支持的远程平台。Hermes Desktop 的 SSH 模式支持 Linux、macOS 和 Windows 远程主机。',
sshErrTimeout: 'SSH 连接超时。主机可能无法访问或处于休眠状态。',
sshErrUpdateRequired: '使用 Desktop SSH 连接前,请更新远程主机上的 Hermes。',
+ sshErrInteractiveAuth:
+ 'Tailscale SSH 需要交互式浏览器验证。请在终端运行 `ssh <host> true` 完成验证后重试——Hermes 以非交互方式运行 SSH。',
sshErrUnknown: 'SSH 连接失败。'
},
keys: {
diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.json
index 45b07f2cc9e..8591897dee7 100644
--- a/locales/_keys.desktop.json
+++ b/locales/_keys.desktop.json
@@ -3138,6 +3138,7 @@
"settings.gateway.sshDesc",
"settings.gateway.sshErrAuth",
"settings.gateway.sshErrHostKey",
+ "settings.gateway.sshErrInteractiveAuth",
"settings.gateway.sshErrNotInstalled",
"settings.gateway.sshErrPlatform",
"settings.gateway.sshErrTimeout",