Skip to main content

Module swarm_remote

Module swarm_remote 

Source
Expand description

The agents of other AgentMux instances, for the Swarm’s sections below this instance’s own tree (docs/specs/SPEC_SWARM_OTHER_HOSTS_AND_CHANNELS_2026_10_02.md).

Phase 2 adds LAN hosts, from the LAN discovery peer list (mDNS and the UDP route): one host per hostname, one channel per advertising instance, names from each peer’s agents list.

Phase 1: other channels on this machine, read from the host-global shared registry (reactive::registry::list_all_shared), the same source the /agentmux/discovery endpoint’s host.cross_channel uses. Names only: the registry carries no status, provider or summary. LAN hosts and cloud installs are later phases and arrive as more RemoteHosts with their own tier.

Phase 4 adds each agent’s state (working, waiting, idle, …) where its instance reports one: a LAN peer’s from the agent-names poll the discovery loop already makes, another channel’s from the same route asked over loopback (channel_statuses). With it, by the owner’s decision of 2026-10-13, each agent’s summary line where its instance shares one (backend::agent_line).

Nothing here carries a credential to the frontend: the registry’s auth_key and local_url are dropped.

Structs§

ChannelReport
What one channel of this machine said about its agents, by lower-cased name.
ChannelStatusTarget
One instance to ask for its agents’ states: (channel, local_url, auth_key).
PairedComputer
A computer this one paired with, as far as the Swarm needs it to tell which LAN host it is.
PeerRoute
A LAN peer’s address and the broadcast key it advertised.
RemoteAgent
RemoteChannel
RemoteHost
SwarmOtherInstancesResult
Response of swarm.other-instances.

Constants§

HIDE_AFTER_MS
Past this an entry is not shown at all. The registry’s own startup sweep only drops entries older than 4 h, and a crashed channel should not look present for that long.
STALE_AFTER_MS
A registry entry not rewritten for this long is shown as stale. The registry heartbeat rewrites every live agent’s entry every 20 s, so this is three missed beats.

Functions§

channel_status_targets
The instances whose agents other_channels lists and that are worth asking: one per local_url, loopback only (as the cross-channel fleet forwarder requires), never this instance, and not a stale one, whose rows are dimmed and show no state.
channel_statuses
Asks each target’s agent-names route, concurrently, for its agents’ states and lines. A target that fails, times out or answers badly contributes nothing.
defined_providers
The definitions’ providers for entries, read from the host-global definition store. Blocking: it reads one file per agent.
fill_account_labels
Name each remote agent’s account when the same account is signed in on this machine: two machines’ sign-ins of one provider account share the stable id, and the label is this machine’s own. An account that is not signed in here keeps its id and gets no label.
fill_defined_providers
Give this machine’s other channels’ agents the provider their definition records, where their instance reported none: an instance from before it reported providers (0.59.30 and older) still shows its agents’ icons (REPORT_SWARM_REMOTE_PROVIDER_ICON_RCA_2026_10_18.md §6.1). A provider the instance reported wins: it describes the live pane. LAN hosts are left as they are: their definitions aren’t on this machine.
lan_hosts
LAN hosts from the discovery peer list. A peer at one of this machine’s own addresses is another channel on this host, which the registry already lists (with more detail), so it is left out here. A peer that did not advertise its channel (an older build) is labelled by its port, so two of them on one host stay apart.
other_channels
Group the shared registry’s entries into this machine’s other channels.
paired_computers
The computers this one paired with to watch their agents.
snapshot
The full answer: this machine’s other channels as one host (absent when there are none), then the LAN hosts.

Type Aliases§

AccountLabels
This machine’s label for each account signed in on it, by the id every machine agrees on (identity::stable_account).
ChannelStatuses
Each channel’s report, by channel.
DefinedProviders
Each agent’s provider id as this machine’s agent definitions record it, by the uid its registry entry carries; a known id only.