Expand description
This machine’s agent containers as the frontend sees them: a name, whose they are, a state and an image,
pushed as container-status when one changes, with the container runtime’s own state as
container-runtime, and read as a whole with GET /api/v1/containers
(docs/specs/SPEC_CONTAINER_STATUS_IN_THE_FRONTEND_2026_11_14.md).
Names and states only. There is no field for a log, an environment, a mount or a statistic, so none can
leak through it. Docker is the source of truth: run follows its event stream, rebuilds from a list now
and then, and this module keeps what it was told (Registry) and says what changed (Hub).
Which containers: those named agentmux-<agent id>, as container_name_for_slug names them. One whose id
is no agent’s is an orphan (agent_id null), because that is the one a person wants to see. Another
container is never listed: a name must carry the label new containers get (AGENT_LABEL), or look like
an agent id (a UUID), or be the id of a definition.
A container that stopped, died or was removed ends its agent’s gateway tokens (a model route’s and the API key’s), whoever stopped it: AgentMux’s
own stops do it where they happen (container::key_route), and this is the one for a stop it did not make (Docker
Desktop, a daemon restart), so the token does not outlive the container and is not given again to one that takes its
place at the same address ([end_gateway_tokens]).
AgentMux’s own helper containers (the gateway forwarder, container::gateway_fwd) are listed too, with helper naming
what they are and no agent.
Structs§
- Container
Runtime Status - The container runtime’s own state, the fields of
containerruntimeavailablewith the time it was seen. - Container
Status - One agent container.
agent_idandagent_nameare null for an orphan. - Containers
List - The answer of
GET /api/v1/containers: what is there now. - Docker
Event - One event about an agent container.
- Docker
Source - Hub
- The registry with the way out: every change it makes is published, once.
- Listed
- One container of Docker’s list.
- Probe
- What a look at the container runtime found.
- Registry
- What Docker (and srv’s own start-up) has said, and what was last published from it.
Enums§
- Action
- An event action that changes where a container is.
- Container
State - Where a container is.
- Published
- What
Hubsays to the outside.
Constants§
- AGENT_
LABEL - The label a new agent container carries: its agent’s id.
- NAME_
PREFIX - The name every agent container starts with (
container_name_for_slug).
Traits§
- Source
- Where the containers are read from.
Functions§
- hub
- The hub, once installed.
- install
- Start publishing on
brokerfor the rest of the process, and return the hub forrun. The first call wins. - note_
starting - srv is about to bring
container_nameup fromimage(empty when it exists already). - run
- Watches for the rest of the process. A machine with no container runtime and no container is looked at once, then left alone until something wakes the hub (a container agent starting, or a reader of the route that finds a runtime).