Put the transport above the drivers instead of inside one

ClaudeDriver::spawn called ssh::command itself, so a translator whose job
is a wire format also knew how sessions reach other machines, and every
future driver would have had to remember the same. It now emits a `Launch`
-- program, arguments, working directory -- and hands it to a `Transport`
the manager chose from the session's host.

This is the inversion Bryan asked for, and it pays for itself immediately
in a place I had reported as a UI bug: "Run on" is offered for every
provider but only the Claude driver honoured it, so choosing a host for an
echo session silently ran it locally. With the transport above the driver
that cannot be written -- EchoDriver builds no Launch, so there is nothing
to wrap and nothing to misreport. The picker still needs to stop offering
it, but the code no longer lies underneath.

crate::ssh keeps the quoting, the forced options and the remote script,
with its tests; transport.rs only decides which of the two it is. The two
failure messages move with it, since they are transport-specific -- a
missing ssh client here is a different thing to check than a program
missing from a remote PATH.

Noted in transport.rs rather than built, because nothing needs it yet: a
remote llama-server is spawned as a process but spoken to over HTTP, so a
transport eventually needs "reach this port" as well as "run this".

Verified: cargo test (35), clippy, fmt. Nothing outside transport.rs
mentions ssh now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xn8nHw1tw1R6PtiY1eEtw
This commit is contained in:
irisandClaude Opus 5 committed 2026-08-28 04:49:55 -04:00
1 parent ba6c770be3
commit 4cdcbd204a
3 files changed
+121 -25

No files matched your search

+3 -1
View File
@@ -13,6 +13,7 @@ pub mod claude;
pub mod driver;
pub mod echo;
pub mod transcript;
pub mod transport;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
@@ -28,6 +29,7 @@ use claude::ClaudeDriver;
use driver::{Driver, Event, ImageRef, SessionStatus};
use echo::EchoDriver;
use transcript::{SeqEvent, Transcript};
use transport::Transport;
/// Fan-out buffer per session. A subscriber that falls further behind than
/// this is caught up from the transcript file instead (see `routes`), so
@@ -472,7 +474,7 @@ fn launch(
DriverKind::ClaudeCli => Box::new(ClaudeDriver::spawn(
&meta,
provider,
host,
&Transport::for_host(host),
&dir,
sink.clone(),
)?),