Skip to content

Remote repositories over SSH#373

Open
lmjiang wants to merge 1 commit into
supabitapp:mainfrom
lmjiang:feat/remote-ssh-repos
Open

Remote repositories over SSH#373
lmjiang wants to merge 1 commit into
supabitapp:mainfrom
lmjiang:feat/remote-ssh-repos

Conversation

@lmjiang
Copy link
Copy Markdown

@lmjiang lmjiang commented May 31, 2026

Closes #65.

First-class support for opening and working in git repositories that live on another machine over SSH — no local clone. This is the PR you invited on #372; happy to iterate on the design or reshape it however's easiest to review.

What it does

  • Open a remote repo (picked from your ~/.ssh/config hosts, or the remote's own supacode config) — it shows in the sidebar as real git, under a Local/Remote partition.
  • Create + list worktrees on the remote, poll their HEAD, host-aware diff/PR.
  • The terminal/zmx and coding-agent orchestration drive the remote exactly like a local repo.

Design — reuses existing architecture, minimal new surface

  • One SSH chokepoint: ShellClient.ssh(host:) rewrites each command into ssh <host> <login-shell-wrapped cmd> (ControlMaster multiplexing). GitClient(shell: .ssh(host:)) then routes every git/wt shell-out over SSH with nothing else changing.
  • Sidebar: remote repos render via a dedicated Local/Remote partition; host-keyed ids (remote:<dest>:<path>) never collide with local repos.
  • Agent presence/notifications over SSH: the local Unix socket the agent hook uses can't cross SSH, so presence + notifications ride in-band over OSC 9 (zmx forwards OSC; libghostty surfaces it), reusing the existing presence pipeline. Local behavior is unchanged (the socket still wins).

Notes — open to direction

  • Premise: both machines run supacode, so the remote agent hook is the OSC-emitting one.
  • Bundles a small fix for a pre-existing bug where dismissing already-read notifications didn't clear the toolbar bell (reproduces on vanilla) — glad to split it out.
  • Tests cover SSH command construction, remote sidebar synthesis, base-ref/fetchOrigin resolution, and OSC parse/routing. Real-host behavior (SSH with a hardware-key touch, libghostty OSC rendering) I verified by hand.
  • Rebased onto current main; Persist terminal layouts incrementally and reap zmx sessions by attach state #369 merges cleanly with this.

One squashed commit (~3k lines) — happy to reorganize/split however helps your review.

…SSH)

Open, browse, and work in repositories on another machine over SSH,
reusing the local terminal/zmx and agent-presence machinery.

- SSH transport via the ShellClient.ssh chokepoint + SSHCommand builders
  (ControlMaster multiplexing, login-shell wrapping)
- Remote repos load as real git over SSH; sidebar Local/Remote partition;
  pick repos from ssh config + the host's own Supacode
- Remote worktree create/list, HEAD polling, host-aware diff/PR; honors the
  creation prompt + base ref + fetchOrigin like local
- Agent awaiting-input + notifications bridged over in-band OSC 9 (the unix
  socket can't cross SSH); toolbar bell surfacing + dismiss fixes
- Tests cover SSH command construction, remote sidebar synthesis,
  base-ref/fetchOrigin resolution, OSC parse/routing

Fork-only divergence (not submitted upstream).
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.

please support ssh

1 participant