Skip to content

SSH host support: watch and control agents on other machines (from @BaoshanPang) - #107

Merged
moritzWa merged 9 commits into
mainfrom
ssh-hosts
Nov 27, 2026
Merged

moritzWa merged 9 commits into
mainfrom
ssh-hosts

Conversation

@moritzWa

Copy link
Copy Markdown
Owner

Brings in SSH host support from @BaoshanPang's fork (5 commits, authorship kept) and fits it to current main.

What it does: --ssh-host HOST merges the sessions of a passwordless-SSH host that runs agentview into the list. Enter jumps in over SSH, Ctrl+O and host:/path start sessions there, /remote add|remove changes hosts live, space peeks a remote OpenCode transcript. Adds agentview opencode attach and launch.

Changes on top of his commits:

  • Resolved conflicts with work view, scheduled commands, mouse hover and the history index; remote folders are hidden in work-only view.
  • Help popup test screen is one row taller for the extra /remote line.
  • Docs: README bullet, docs/cli.md launch section, CHANGELOG credit.
  • Speed: measured that a slow host delayed the whole refresh (local-only 3.4 s; a 3 s host 5.0 s; a 10 s host 12.4 s), so local status would lag. In the dashboard, hosts now refresh in a background thread and a refresh reports each host's last answer (re-asked at most every 3 s). --json still waits. Tests cover both.

Tested: full cargo test passes (1125 lib tests). Not yet tried against a real second machine.

bpang and others added 9 commits November 26, 2026 23:10
--ssh-host HOST runs agentview --json on a passwordless SSH host each
refresh and merges its snapshot: rows are tagged [host] in the list,
marked Runtime::Ssh in Peek, and inspect-only. /remote lists, adds, and
removes hosts at runtime and persists the set to ssh-targets.json; a
host running under AGENTVIEW_REMOTE=1 keeps a frozen list so two
machines watching each other cannot fan out.

Enter jumps into a remote session through the provider's own attach
(claude attach/--resume, opencode --session, codex resume) as a normal
PTY handoff. Remote commands export the per-user agent CLI homes into
PATH (non-interactive shells miss them) and fall back to ~/.tmp for
TMPDIR on hosts whose /tmp is mounted noexec.

ctrl+o and the directory view offer each host's known folders as
[host] /path and start new sessions there. Claude and Codex receive the
typed task as their argument; OpenCode launches through the host's own
agentview supervisor via the new 'agentview opencode launch "task"
--cwd DIR [--model M]' command, which creates a managed session on the
supervisor server and prints it as JSON, so idle sessions show
Completed and both dashboards own them. Hosts without that subcommand
fall back to typing the task into the TUI once its editor is on
screen. Model picks and --yolo stay local-only.
The picker's typed-path fast path only offered folders that exist
locally, and remote candidates only listed folders with sessions in
them, so a folder like /extra on a watched host was unreachable unless
something had run there. Typing 176:/extra (a watched host, then an
absolute path) now offers it first, deduplicated against the session
candidates, and the search hint says so.
Peek for remote rows fell back to the 160-character summary because the
local OpenCode controller cannot read a transcript on another host.
Inspecting a Runtime::Ssh OpenCode session now exports it on the host
(opencode export into a temp file, since a piped export truncates at
64 KiB), reads a bounded 400 KiB tail, salvages the complete trailing
messages from the fragment, and renders them with the same
message renderer local peeks use. Other providers are refused with a
clear notice for now.
Opening a remote OpenCode session ran a direct 'opencode --session'
TUI, which starts its own server instance on that host: turns typed
there were invisible to the supervisor's /session/status, so managed
discovery kept reporting an in-flight session as idle (Completed). The
new 'agentview opencode attach SESSION_ID [--cwd DIR]' attaches a TUI
to this agentview's own server, and the remote open path prefers it —
hosts without the subcommand fall back to the direct TUI. Verified:
a turn submitted in the attached TUI shows working/managed_server on
both dashboards and settles to Completed when idle.
Upstream's new Voice host started a session through launch_with, which
now takes a remote host argument; the voice launches locally. Upstream's
history search also uses Option::is_none_or, stabilized after the
rust-version floor this checkout builds with; map_or covers both.
@moritzWa
moritzWa merged commit a0ea0dd into main Nov 27, 2026
21 checks passed
@moritzWa
moritzWa deleted the ssh-hosts branch November 27, 2026 04:39
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