Skip to content

feat(desktop): add SSH server connections - #47753

Merged
Brendonovich merged 8 commits into
v2from
desktop-ssh
Sep 9, 2026
Merged

Brendonovich merged 8 commits into
v2from
desktop-ssh

Conversation

@Brendonovich

@Brendonovich Brendonovich commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add desktop SSH server connections with saved hosts, automatic restoration, reconnects, and local HTTP tunnels to persistent remote OpenCode services.
  • Add a compact SSH connection form, askpass-driven authentication, SSH badges, connection health states, and disconnected-draft protection. Keep submitted inputs visible while awaiting the next SSH prompt.
  • Share CLI discovery, version checks, and installation helpers between WSL and SSH. Use existing remote service commands for startup and explicit updates.
  • Keep cross-package changes limited to the executable CLI askpass hook and Storybook support for the app's SSH fixtures.
  • Show explicit authentication actions and an inactive-session reconnect panel. Key-based reconnects stay inline; password and verification challenges open only when SSH requests them. Cancelling restores the previous connection state and allows another attempt.
  • Run POSIX remote-shell fixtures on Linux/macOS while retaining Windows coverage for command parsing, askpass, connection lifecycle, and renderer behavior.

SSH connection form

SSH connection form

New SSH dialog, captured from the committed branch's Storybook fixture at 800 × 500.

Recording

Password → verification code → connected, with a five-second fixture delay after each response. Inputs stay visible and disabled until the next prompt arrives. Recorded from app-dialog-ssh--slow-password at 800 × 500 (12.4 seconds).

ssh-password-flow.webm

Inactive session and reconnect

Inactive SSH session reconnect panel

Reconnect → inline connecting state → password and verification challenge → connected. Captured from app-dialog-ssh--inactive-session at 800 × 500 (11.3 seconds). This is a new SSH surface with no corresponding base-branch screen.

ssh-reconnect-final.webm

Review fixes

  • Keep interactive reconnect coordination at window scope so server-row updates cannot discard its prompt handler.
  • Release the UI attempt when a version-mismatch dialog is cancelled, allowing another reconnect.
  • Preserve another window's active authentication attempt and present it as pending.
  • Validate cached tunnels during resolution and rediscover changed remote ports or credentials; concurrent callers share the replacement attempt.

Cancel a version-mismatch dialog, reconnect successfully to the dialog again, and cancel again. Recorded from app-dialog-ssh--incompatible-session at 800 × 500 (5.6 seconds).

ssh-retry-fixed.webm

Validation

  • Desktop, app, and CLI typechecks; repository pre-push typecheck hook.
  • 48 targeted tests covering SSH askpass, setup/discovery, connection lifecycle, WSL installation, reactive renderer connections, health transitions, draft preservation, and saved-server restoration.
  • After merging current v2: 961 app tests passed; desktop CI-mode suite passed (158 tests, 2 platform/display skips).
  • Review fixes: 965 app tests, targeted SSH controller/renderer tests, and 2 production-component browser regressions passed. Both affected package typechecks and the repository pre-push typecheck passed. Recording-only settings and pauses were removed, then both component regressions passed again.
  • Fixture-driven password → delayed verification-code → connected flow; submitted fields remain visible and disabled while waiting.
  • Fixture-driven inactive-session → reconnect → authentication → connected flow verified; recording-only configuration was not committed.
  • Manual password login against a local Docker OpenSSH server.

Native Windows/WSL and packaged-app testing remain review follow-ups for this draft. The new upstream display-dependent browser suite failed locally at browser.hover with UnknownVizError; that suite is already excluded from CI by its existing display guard.

@Brendonovich
Brendonovich marked this pull request as ready for review September 8, 2026 06:36
@Brendonovich
Brendonovich requested a review from Hona as a code owner September 8, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant