Skip to main content

Module remotes

Module remotes 

Source
Expand description

The Connectors → Remotes list (SPEC_REMOTES_PANE_2026_10_05.md §4.6): every remote machine AgentMux knows about, one record each, built from what srv already keeps:

  • the hosts named in ~/.ssh/config (ssh_config);
  • the per-connection settings (settings.json → connections);
  • recent connections (remote-recent.json, kept here, §4.5);
  • WSL distributions (wsl);
  • each connection’s status (status);
  • where the helper is, and each host’s platform (helper_hosts);
  • which agents may use a host (agent_access);
  • the last count of durable sessions seen on a host (kept here).

Building the list never opens an ssh connection.

Structs§

Inputs
Everything build reads, gathered by list.
RecentEntry
One SSH connection that has reached connected.
RecentFile 🔒

Constants§

MAX_RECENT
Recent connections kept; the least recently used goes first.
RECENT_FILE 🔒
TOUCH_EVERY_MS 🔒
A connection already recent is re-written at most this often.

Statics§

RECENT_LOCK 🔒

Functions§

apply_connection_values
Apply values to connection’s entry in the raw connections object of settings.json: a null removes a key, an entry left empty is removed. Works on the raw JSON, so keys AgentMux doesn’t know survive untouched.
build
One record per remote, by name (the pane sorts them into sections).
check_connection_entry
Refuse an edit that would leave connection’s entry unreadable (a string where display:pinned wants a boolean, say): the write would land on disk while the live config silently kept the old values.
forget_recent
forget_recent_in under this instance’s config dir.
forget_recent_in
Forget connection from the recent list. Returns whether it was there.
identify 🔒
The canonical name and kind of a connection name, or None for local.
list
The list now, for RemotesList. settings is FullConfigType::connections.
note_sessions
Remember how many durable sessions connection’s host had when last listed (the list never opens ssh to count them).
platform_of
uname -sm → platform.
publish_change
Tell every open Connectors → Remotes its list changed.
read_recent 🔒
recent_in
The recent list, most recently used first.
recent_path 🔒
record_recent
record_recent_in under this instance’s config dir, now. Best effort.
record_recent_in
Record that connection (SSH only) was used at now_ms. Returns whether the list changed (a new entry); touching an existing one is written at most once a minute.
session_counts 🔒
ssh_name 🔒
write_recent 🔒