Expand description
Agent seats: an agent’s role, the agent it reports to (its lead) and what
it owns (its area), SPEC_AGENT_SEATS_IN_THE_UI_2026_10_23.md.
A seat is stored on the agent’s shared definition record
(DefinitionRecordV1::seat), set by the operator through agent.setSeat
or by an agent through Agents set_seat (app_api/agent_seats.rs). This module holds what reads and writes have in common:
the validation of a new seat (§2), the effective seat of a spawned worker
that has none of its own, and the summary shown in MuxAPI’s Agents list,
a LAN peer’s agent list and My Agents (§4, §5). Seats inform; nothing is
refused because of one.
Constants§
- MAX_
AREA_ CHARS - MAX_
LANE_ CHARS - The spec gives
laneno limit; it’s a short name, like the qualifier. - MAX_
QUALIFIER_ CHARS - ROLES
- The roles a seat may name, as stored.
- SEAT_
META_ KEY - The block meta key an agent pane keeps its agent’s seat summary under,
for the pane header’s tooltip (§4). Seeded at
agent.open, asui:coloris, and refreshed byagent.setSeat(stale_seat_meta). - SPAWNED_
QUALIFIER - The qualifier of a spawned worker’s effective seat.
- SUPER_
ROLE - The role of the one agent that reviews sensitive operations
(
SPEC_SUPER_AGENT_2026_10_25.md): at most one in the shared agent roster, since a seat is stored on the shared definition. - WORKER_
OF_ CONTENT - The worker’s leader,
{agent, id}, kept on the worker’s definition (agent content) as well as on its pane, so a worker reopened from My Agents, whose new pane has noagent:coached_by, is still a worker: it can’t spawn and still counts toward its leader’s limit. srv writes it;setagentcontentrefuses it from a client, and a fork of a worker doesn’t inherit it.
Functions§
- apply_
effective_ seats - Give every definition in
defs(asagent_def_listreturns them) its effective seat. - effective_
seat - The seat a definition is shown with: its stored seat, or, for a spawned
worker (
agent:worker_of) with none, role worker, qualifier “spawned” and its leader as lead (§2). Computed when read, never stored; a seat the operator sets wins.def.seatmust be the stored one, asagent_def_listreads it. - effective_
seat_ by_ id effective_seatby uid, for a reader that has no definition list: the stored seat from the shared record, else the spawned one.- is_
remote_ lead - A lead that is an agent on another machine,
Name@hostasAgents listshows it. A uid srv minted holds no@. - is_role
- Whether
roleis one a seat may name. - is_
steward - Whether a seat names its agent this computer’s steward: in its qualifier or the line about what it owns. There is no steward role; the steward is who the machine’s own notes go to (a low disk, a flag of the record).
- no_
cycle - Refuse
leadasagent_id’s lead when following leads from it comes back toagent_id. Also checked when a spawned worker’s seat is cleared: its leader becomes its lead again. - sanitize_
peer_ summary - A seat summary a LAN peer sent, made safe to show (§5): a known role
only, each text on one line and within its limit (cut, not refused: the
peer validated it, this only bounds it).
Nonewhen it can’t be read. - seat_
meta agent:seatas a meta value: the summary, ornullfor none, which a meta patch reads as “remove the key”.- seed_
meta - Put agent
id’s seat into the meta of a pane being opened for it, when it has one. - stale_
seat_ meta - The agent panes among
blockswhoseagent:seatno longer matches the seatsummary_ofgives their agent now, each with the value to patch in.summary_ofis asked once per agent. - summarize
- A seat as shown, with its lead’s name from
name_of(§4). - summary_
by_ id summary_inby uid, for a reader that has no definition list. The list isagent_def_list’s, which lays each shared record over the local row, so a lead renamed in another channel is named as My Agents names it (agent_def_getreturns the local row as it is).- summary_
in - The summary of the seat definition
def_idis shown with (its effective seat), its lead named fromdefs.defsisagent_def_list’s, so each carries its stored seat.Nonewhen it has no seat. - super_
holder - The uid of the agent whose stored seat is the super agent’s, if any.
- validate
- Validate the seat the operator asks for on agent
agent_id, and stamp it withnow_ms(§2).is_agentsays whether a uid is an agent on this machine;lead_ofgives an agent’s current lead (its effective seat’s), which is how a cycle is found: following leads from the new lead must not come back toagent_id. - worker_
of - The leader definition
def_idis a worker of, if any.