Skip to main content

Module live_facts

Module live_facts 

Source
Expand description

What each agent runs on and is doing now, for Agents list, Agents status and the Swarm. What an agent is running on and doing now, read from AgentMux’s own runtime state and never from the agent’s say-so (docs/specs/SPEC_MUXAPI_AGENT_LIVE_FACTS_2026_11_20.md). One builder, [facts_of], for Agents list, Agents status and the Swarm’s rows.

The model and effort come first (model, the one group every row carries in short form); the rest are groups a caller asks for by name (Select), so a default row stays small and each group costs only when asked. Never in a fact: a credential, a vault entry, a prompt or a message (spec §3, “Not exposed”).

Re-exports§

pub use model::ModelFacts;

Modules§

handler
GET /agentmux/discovery with the live facts’ parameters (spec §5): the same answer as ever with no parameter, this host’s agents narrowed, paged and given the groups asked for with fields, detail and the filters, or, with view=status, the compact status (Agents status). The same answer is what the LAN op agents.status gives a peer (answer).
model
Which model an agent runs on, and where that answer came from (spec §3 and §7). Pure: the caller reads the runtime state and hands it in, so every order of preference is a test.
query
The parameters of Agents list and Agents status (spec §5): which groups, which agents, which page; and the two answers built from them. Filters run on the cheap facts (state, model, provider, runtime, account) for every agent; the groups asked for are read only for the agents of the page.

Structs§

AccountFacts
The account the agent’s run is on: a stable id and the label Identity accounts shows. Never a credential.
Agent
One agent, as a caller of facts_of knows it.
ContextFacts
How full the agent’s context is. In memory: absent until the agent’s next frame after srv starts.
Ctx
What every agent of a call shares, read once.
HostFacts
The AgentMux the agent runs in.
LiveFacts
The groups asked for; each is absent when not asked for or when nothing says.
QuietFacts
An agent that owes work and has done nothing for the quiet time (SPEC_LEADER_TOLD_WHEN_AN_AGENT_GOES_QUIET_2026_11_21.md §6): the Swarm’s and the Kanban’s “quiet 22 min”. Read from the last sweep, so it can be up to half a minute behind; absent while the agent is not quiet.
RuntimeFacts
Where an agent runs and how it is set up.
Select
Which groups a caller asked for.
SessionFacts
When the agent’s process started.
TaskFacts
The Kanban tasks the agent holds now.
TurnFacts
Whether the agent is in a turn, and since when.

Constants§

CONTEXT_STALE_MS 🔒
A context reading with no new call for this long, in a turn, is stale.

Functions§

account_of 🔒
The account the pane’s run is on (agent:run_account), with its stable id, label and usage.
block_of 🔒
The agent’s own block, when it has one.
claimed_tasks 🔒
The Kanban task numbers each agent holds.
context_of 🔒
facts_of
The groups of sel for a. model is the answer model_of already gave, so it is read once.
host_of 🔒
model_of
The model and effort: the one group every row carries (short, as model_label and model_source).
quiet_of 🔒
runtime_of 🔒
safe_label 🔒
The account’s name for a reader of the fleet: its display name or its name, never an email (a name can be one, and the account’s own label falls back to the email) and never read from its context.
session_of 🔒
task_of 🔒
turn_of 🔒