Skip to content

feat: Remote SSH PRD Phase 4 — Native desktop SSH transport - #370

Open
Ziinc wants to merge 2 commits into
mainfrom
claude/remote-ssh-prd-phase-4
Open

feat: Remote SSH PRD Phase 4 — Native desktop SSH transport#370
Ziinc wants to merge 2 commits into
mainfrom
claude/remote-ssh-prd-phase-4

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #369 (Phase 3). Implements Phase 4 of prds/remote-ssh.md ("Native desktop SSH") in a new module, src-tauri/src/core/remote_ssh_transport.rs, built on russh.

  • Strict host-key verification against Phase 3's recorded TrustedHostKey fingerprints — no bypass, no trust-on-first-use, independent of ~/.ssh/known_hosts.
  • Auth via existing private key or certificate+key, consuming Phase 1/3's SshAuthentication model.
  • Connection pool keyed on endpoint id + generation + host + port + user + host-key fingerprints, so reprovisioning/host-key rotation never reuses a stale connection; dead-connection detection and transparent reconnect (never auto-retries an in-flight exec).
  • Non-interactive exec channel running treq <args> --format=json with deadline, output-size cap, cancellation, and a structured SshTransportError for Phase 5 callers.
  • PTY channel primitive (open/write/read/resize/close) for later terminal/agent wiring in Phase 6.
  • Keepalives on idle pooled connections and idle-sweep.
  • Redaction: no key material, certs, or raw command/terminal output in logs.

Scope notes

  • The old system-ssh subprocess call sites (core::remote.rs: SshCliTransport, check_readiness, probe_repo, clone_repo, build_ssh_shell_command) are left untouched. They operate on the legacy alias-based SshHost model, not the Phase 1 SshEndpoint/SshAuthentication model this transport consumes — rewiring those call sites onto the new transport is Phase 5/6's job (typed CLI commands + UI integration). No new code path in this PR shells out to ssh.
  • Connection/channel metrics are deferred to Phase 7 (observability), per the PRD's phase split.

Test plan

@Ziinc
Ziinc force-pushed the claude/remote-ssh-prd-phase-3 branch from dddd041 to b841412 Compare August 28, 2026 15:19
@Ziinc
Ziinc force-pushed the claude/remote-ssh-prd-phase-4 branch from f01b6bc to eaf7b9e Compare August 28, 2026 15:21
Base automatically changed from claude/remote-ssh-prd-phase-3 to main August 28, 2026 16:09
@Ziinc Ziinc changed the title Remote SSH PRD: Phase 4 — Native desktop SSH transport feat: Remote SSH PRD Phase 4 — Native desktop SSH transport Aug 28, 2026
claude added 2 commits August 28, 2026 16:10
Implements the Phase 4 "Native desktop SSH" delivery phase from
prds/remote-ssh.md: a pure-Rust russh-based client transport that
replaces system ssh subprocesses for the managed SSH path.

- Strict host-key verification against Phase 3's TrustedHostKey
  fingerprints, with no bypass and no fallback to the OS known_hosts.
- Client authentication via existing private key or certificate+key,
  consuming the Phase 1 SshAuthentication/SshEndpoint model.
- A connection pool keyed on endpoint id, generation, hostname, port,
  username, and host-key fingerprints, reusing one authenticated
  connection across exec and PTY channels with keepalives and
  transparent reconnect of dead connections.
- Non-interactive exec channels for `treq <command> --format=json`
  with total deadlines, output size limits, cooperative cancellation,
  and a structured error type distinguishing host-key, auth, deadline,
  output-limit, cancellation, and command-failure outcomes.
- Interactive PTY channel primitive (open/write/read/resize/close) for
  later terminal/agent wiring.

Unit tests cover host-key accept/reject, pool key derivation, and
exec-channel deadline/output-limit/cancellation/reuse behavior against
an in-process russh::server mock, with no network or real credentials.
@github-actions

Copy link
Copy Markdown
Contributor

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.

2 participants