Skip to content

fix(desktop): surface Tailscale SSH browser checks - #97871

Merged
OutThisLife merged 1 commit into
NousResearch:mainfrom
arcabotai:fix/desktop-ssh-actionable-auth
Sep 29, 2026
Merged

OutThisLife merged 1 commit into
NousResearch:mainfrom
arcabotai:fix/desktop-ssh-actionable-auth

Conversation

@arcabotai

@arcabotai arcabotai commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Hermes Desktop now recognizes when Tailscale SSH is waiting for an interactive browser check instead of reporting the wait as a generic half-open connection timeout.

The timeout path keeps only a safe classification of buffered SSH stderr. It does not retain or surface Tailscale's one-time authentication URL. Desktop tells the user to complete the check from Terminal and retry.

This is deliberately narrower than changing timeout lengths or SSH lifecycle behavior. Generic timeouts still use the existing half-open connection message.

Related Issue

Fixes #97867

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • apps/desktop/electron/ssh-connection.ts
    • classifies Tailscale SSH browser-check output as interactive authentication;
    • carries only that classification across the hard-timeout boundary;
    • returns safe, actionable Terminal pre-authentication guidance.
  • apps/desktop/electron/ssh-connection.test.ts
    • lets hanging fake SSH children emit stderr before timeout;
    • reproduces the Tailscale challenge and verifies the one-time URL never reaches the user-facing error.

How to Test

  1. Run cd apps/desktop && npx vitest run --project electron electron/ssh-connection.test.ts.
  2. Confirm the Tailscale regression reports interactive-auth, includes ssh user@host true guidance, and excludes login.tailscale.com plus the one-time URL token.
  3. Run npx prettier --check electron/ssh-connection.ts electron/ssh-connection.test.ts, ESLint on both files, npx tsc -p tsconfig.electron.json --noEmit, and the full Electron Vitest project.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass - N/A, this is isolated TypeScript/Electron code
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Linux contract tests; the original failure was observed on macOS Apple Silicon

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) - N/A, no public configuration or workflow changed
  • I've updated cli-config.yaml.example if I added/changed config keys - N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows - N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide
  • I've updated tool descriptions/schemas if I changed tool behavior - N/A

Verification

Blaxel Linux microVM, Node v22.22.1, npm 10.9.8:

  • RED: focused suite reproduced the bug with exactly one expected failure (timeout instead of interactive-auth).
  • GREEN: focused Desktop SSH suite 68 passed.
  • prettier --check: passed.
  • ESLint on the two changed files with --max-warnings=0: passed.
  • Electron TypeScript typecheck: passed.
  • An exploratory broader Electron run passed 1,929 tests and skipped 6. Four tests and two suites could not run because the slim worker intentionally omitted Python and Electron's postinstall binary. Those failures were outside ssh-connection and were classified as worker-prerequisite failures, not patch regressions.
  • Live patched macOS artifact was not rebuilt. The real failure was observed there; the fix is verified at the process/error-contract boundary.

Provenance

Prepared by Cad, an AI agent, under Luis Felipe Abarca's direction. The arcabotai contributor identity is human-stewarded by Luis Felipe, who authorized this issue and pull-request submission. Public background and project context: felirami.com, arcabot.ai, and arca.computer.

@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) backend/ssh SSH remote execution P2 Medium — degraded but workaround exists labels Aug 29, 2026
@Enough1122

Copy link
Copy Markdown
Contributor

AI code review — automated review for reference; please use your judgment.

fix(desktop): surface Tailscale SSH browser checks

Good, security-conscious change. Detecting the Tailscale "additional check" stderr and mapping it to a new INTERACTIVE_AUTH error kind, then emitting non-interactive guidance (ssh <host> true, complete the browser check, retry) is the right UX. The one-time URL is deliberately kept out of the surfaced message (the test asserts doesNotMatch against login.tailscale.com), and stderrKind carries only the classification through the timeout path — properly defensive about leaking a one-time auth URL through Desktop errors or lifecycle logs.

Non-blocking observations:

  1. Classification is only consulted on the timeout path. The stderrKind → INTERACTIVE_AUTH mapping is applied inside the if (stderrOrErr.kind === SSH_ERROR.TIMEOUT) branch. If ssh exits quickly (non-zero, e.g. code 255) carrying the same Tailscale "additional check" stderr rather than hanging until the timeout, the guidance won't surface. Consider classifying the immediate-exit path too, or adding a test for a fast exit with that stderr.

  2. Regex requires the https scheme and exact host. /To authenticate, visit:\s*https:\/\/login\.tailscale\.com\// won't match if Tailscale ever varies the scheme or host. Low risk (the message is currently fixed), but a looser match (e.g., the "requires an additional check" line alone) would be more robust.

  3. classifySshError now runs on every timeout. Setting err.stderrKind = classifySshError(stderr) on every timeout is negligible cost, but worth noting it's a regex pass added to an already-error path. Fine.

@OutThisLife
OutThisLife force-pushed the fix/desktop-ssh-actionable-auth branch from b787cec to 660606f Compare September 28, 2026 22:44
@OutThisLife
OutThisLife force-pushed the fix/desktop-ssh-actionable-auth branch from 660606f to ce55f3c Compare September 29, 2026 01:25
@OutThisLife
OutThisLife merged commit e4956f5 into NousResearch:main Sep 29, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend/ssh SSH remote execution comp/desktop Electron desktop app (apps/desktop/*) P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Desktop hides Tailscale SSH browser checks behind a generic timeout

4 participants