Expand description
The names-only fleet feed LAN peers read: GET /agentmux/fleet and its
Server-Sent Events stream GET /agentmux/fleet/events
(docs/specs/SPEC_LAN_FLEET_FEED_2026_10_03.md §2, which links the
mobile spec that owns the wire contract).
One task compares this instance’s reachable agent names once a second and
publishes (rev, names) through a watch, so the snapshot route and every
stream read the same value and no stream can fall behind: a slow reader
skips straight to the latest state. Agent names only, the same line
handle_reactive_agent_names holds for a lan_key holder, plus (owner
decision 2026-10-06, agentmux-mobile’s
SPEC_FLEET_HOST_TAGS_AND_CLOUD_HOSTS_2026_10_06 §5.1) where each agent
runs (agent_kinds), how many channels this machine runs, its platform
and this install’s id; and (owner decision D1, 2026-10-07, agentmux-mobile’s
SPEC_AGENT_STATUS_AND_LIVE_PANE_FEED_2026_10_07 §3.2, §13.1) each agent’s
state and since when (agent_status, backend::agent_state), with this
machine’s clock (now_ms); and, while it is up, the viewer listener’s port
(same spec §13.2), which opens nothing by itself; and (owner decision
2026-10-13) each agent’s summary line (agent_lines, backend::agent_line),
absent while swarm:sharesummaries is off. The cloud presence publisher
(muxbus::wan_presence) reads the same snapshot.
Structs§
- Fleet
Body 🔒 - The
/agentmux/fleetbody, in the contract’s field order. - Fleet
Feed - Fleet
Observation - What one look at the instance found: each reachable agent with its kind,
Nonewhen its block couldn’t be read, the channel count, and the state of each agent that has one, by name. - Fleet
Snapshot - One state of the fleet.
revstarts at 1 and goes up by one on every change of any field below;agentsis sorted case-insensitively and de-duplicated;agent_kindsandagent_statushave an entry for each ofagentswhose kind or state is known. - Stream
Slot 🔒 - A held stream slot; releases it on drop.
Constants§
- CHANGE_
POLL_ INTERVAL - How often the name set is compared.
- HEARTBEAT 🔒
- HEARTBEAT_
INTERVAL - Comment line sent on an idle stream, so a client can tell a dead TCP connection (30 s of silence, spec §6) from a quiet fleet.
- MAX_
STREAMS - Concurrent event streams per srv; beyond this a request gets 503, so a LAN
peer holding the
lan_keycannot exhaust the srv. - RETRY_
PREAMBLE 🔒 - The stream’s first write: how long an SSE client waits before reconnecting.
Functions§
- normalize_
agents 🔒 - Sort case-insensitively and drop names that differ only by case (registration keys are lower-cased, so those are one agent). Ties break on the exact string so the result does not depend on input order. Each surviving name keeps its own kind.
Type Aliases§
- Agent
Kind - An agent’s kind as the feed reports it:
"host"or"container"(operator_config_seed::agent_kind).