Appearance
Assistant SSH tools
The Uptinio assistant can open an SSH session to a project server and run install/admin commands using vaulted credentials. This is separate from the Go agent poller channel (run_server_command).
Tools
| Tool | Purpose |
|---|---|
run_ssh_command | Run command (shell string) or argv (array) over SSH |
install_on_server | Build a package-manager install command and run it over SSH |
Prefer run_server_command when the Go agent is online and the command is a simple allowlisted argv. Use SSH for package installs and broader admin work. Keep Ruby Net::SSH for hosts without a suitable Go agent.
Auth & host
- Host:
server.public_ip→private_ip→hostname - Port: tool arg → credential
metadata.port/ URL →22 - Username: tool arg → credential
fields.username→root - Credential kinds:
ssh_pem(private_key, optionalusername) orusername_password - If
credential_refis omitted and the project has exactly onessh_pem, that credential is used; otherwise the tool returnsneeds_credentials credential_refacceptscred:UUID, exact/case-insensitive name,@namechat mentions, and slugified names (e.g.@uptinio-root-key)
Private keys and passwords are never returned to the model. stdout/stderr are scrubbed via CredentialBroker.
Approval
Commands pass CommandAllowlistFilter unless project.allow_all_commands. Non-allowlisted commands return needs_approval and reuse the same command-approval widget / resume path as run_server_command (resume_tool: run_ssh_command or install_on_server).
Implementation
- SSH runs inside
AssistantChatJob(Que), not the HTTP/SSE request. Closing the tab does not abort SSH. SshCommandRunner— Net::SSH session; captures stdout/stderr/exit status; closes the session inensure- Host-key policy is currently
verify_host_key: :never(ephemeral containers); operators should pin host keys for production - Timeout hard cap: 300 seconds (default 60 for
run_ssh_command, 120 forinstall_on_server) SshCommandRunnerforce-closes the Net::SSH session when the budget expires (RubyTimeoutalone is unreliable against blocking IO) and emits progress every ~5s (SSH still running…)- Progress is broadcast as ActionCable
statusevents viaActionsTracker#emit_status - Transport failures (
timed_out,auth_failed,host_unreachable, …) return structured tool results and notify Bugsnag viaAssistantErrorNotifier - Agent update path:
get_server_install_instructions→ onerun_ssh_commandwithupdate_command/install_command(timeout 120–180s, max 300). Do not chain extra package-manager steps in the same SSH call.
Package managers (install_on_server)
| Manager | Command shape |
|---|---|
apt (default) | DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y … |
dnf | dnf install -y … |
yum | yum install -y … |
apk | apk add --no-cache … |