feat(desktop): connect self-hosted agents
Stacked on #3990. The incremental review for this PR is two commits:
feat(desktop): connect self-hosted agents Buzz does not ownrefactor(desktop): split initial window helpers
Summary
- add connected-agent storage separate from Buzz-managed agent records
- add read-only/connect Tauri commands for recording self-hosted agent identities by host, pubkey, name, and observed harness
- add the desktop Connect agent dialog and Connected agents section
- validate pubkey input so pasted secret keys are rejected and never echoed
- keep connected agents out of lifecycle/spawn fields by using a dedicated record type
- move existing initial-window helpers out of
lib.rsso new command registrations stay within the desktop file-size guard
Why
Some agents already run outside the Buzz desktop process. Buzz should be able to remember and display those identities without taking custody of their keys, command, process lifecycle, or environment.
The additional Tauri commands also pushed the app entrypoint across its file-size limit. The initial-window helpers now live in a focused module with no behavior change.
Validation
cargo fmt --manifest-path desktop/src-tauri/Cargo.toml --checkcargo test --manifest-path desktop/src-tauri/Cargo.toml remote_agent_connect --libcargo test --manifest-path desktop/src-tauri/Cargo.toml connected_agents --libjust desktop-tauri-clippycd desktop && pnpm checkcd desktop && pnpm typecheckcd desktop && node --import ./test-loader.mjs --experimental-strip-types --test src/features/agents/ui/connectAgentIntent.test.mjsgit diff --check origin/pr/remote-harness-discovery..HEAD
I reviewed the connected-agent path at the current head (the latest initial_window extraction does not affect these findings). The separate public-only store and lack of local lifecycle controls are strong boundaries, but I think two issues need resolving before the UI calls this a connected agent:
-
The host is not bound to the supplied identity.
connect_remote_agentaccepts any valid pubkey for any configured SSH alias, and the UI intentionally allows submission after a failed/absent probe. Reachability plus an observed harness binary does not prove that the holder of that pubkey runs on that host. I would model this as an unverified endpoint bookmark unless a host-executed signed challenge or matching self-signed relay assertion establishes the binding. Tests should cover mismatched host/pubkey and stale/replayed proof. -
The SSH probe can disagree with OpenSSH and runs before explicit consent. The partial parser ignores
Include,Match, global/default precedence, inline-comment and first-obtained-value semantics, then passes its parsed port with-p, overriding the effective configuration. Prefer passing only a validated alias and deriving facts fromssh -G alias. Opening the dialog selects the first host and starts a POSIX-shell probe automatically; that invokes remote CLIs with--versionbefore an explicit Probe action and does not support Windows SSH targets. Please make probing explicit and platform-aware.
The product-level split I would preserve is: community agents come from signed relay identity/membership facts; this file supplies only optional local endpoint annotations keyed by pubkey. That retains the good secret/lifecycle isolation here without making SSH a prerequisite for visibility or implying an unproven host↔identity relationship.
@murdawkmedia this framing makes sense to me. I agree the current shape is closer to a local endpoint annotation/bookmark unless we add a real host↔identity proof.
I’m going to defer changes here for now because this crosses SSH discovery, identity proof, UI wording, and the still-open direction in #4174. I’ll keep this draft until that abstraction is clearer rather than trying to patch one piece in isolation.
Follow-up after the current #4174 review: I am keeping this PR draft and am not patching the existing stack in place. The review findings still stand: the current code neither proves a host-to-pubkey binding nor matches OpenSSH resolution/explicit-consent semantics closely enough to label the record a connected agent.
The upstream direction now makes signed relay identity and directory facts the authoritative visibility path. If this local feature is revived, it should be redesigned as an optional endpoint annotation keyed by an already-known pubkey, use explicit user-triggered probing via effective OpenSSH configuration, and avoid implying identity proof without a fresh signed challenge. That is a contract change, not a safe incremental fix on the current conflicting branch.
Closing this draft because persistent connected-agent records and SSH-backed lifecycle assumptions no longer match Buzz's relay-native remote-agent/provider direction in #4174. Any harness-specific connection logic will live outside Buzz and consume public contracts. The source branch is being retained.
Thanks for following up on the review and closing the superseded draft. I agree with keeping signed relay identity separate from optional local endpoint annotations. If the local annotations return, explicit probing and an honest unverified label remain the right starting point until a host-to-key binding is proved.