Skip to main content

Module worker_notes

Module worker_notes 

Source
Expand description

A leader hears when its workers (and the agents that hold its tasks) fail, stop or wait on a question. A leader hears from its workers without polling (docs/specs/SPEC_AGENT_WORKERS_2026_10_15.md §3.3).

A watched agent (a spawned worker, a definition carrying agent:worker_of, app_api::agent_spawn; or any agent that holds a claimed Kanban task) that is waiting for an answer, fails, or whose process exits gets its watchers (its seat lead, its leader, the agents that filed its tasks) an [AgentMux] note in their open pane. A worker whose turn ends with a question for its leader and no report gets one too; a turn that ends without a report is no note by itself, since quiet_watch tells the watchers when the agent has gone quiet (SPEC_LEADER_TOLD_WHEN_AN_AGENT_GOES_QUIET_2026_11_21.md §7). At most one note per agent a minute; a held one is counted in the next.

Installed at boot (not with the notify Router, which starts only when a window connects): a broker observer forwards turn ends and failures, and a reducer subscriber a question still waiting after its grace, to a task that does the store reads and the delivery.

Functions§

absorb
Copy the successful deliveries in audit into REPORTS.
install
Start listening. Called once from main.
last_report
When worker (its agent id) last messaged one of leader_panes.
live_panes_of
The open panes (in a tab) of definition def_id.
tell_leader
Tell the lead of the agent def_id something about it, as an [AgentMux] note: its seat’s lead (a spawned worker’s is its leader) when that agent is on this machine and has a pane open. false when nobody was told: it reports to the operator, its lead is on another machine, or its pane is not open.
tell_leader_held
Like tell_leader, for a note that asks nothing: it joins the leader’s turn if one is running, else waits under key for the next one (a second note under the same key replaces the first). It never starts a turn.