Skip to main content

Module registry_reconcile

Module registry_reconcile 

Source
Expand description

Puts a running agent back in the reactive registry when it has fallen out of it (task #2093).

An agent is addressable (a message reaches it, Agents conversations and Agents transcript find it) only while the registry holds it, and the registry is written when its process spawns. If the entry goes while the process lives (a closing tool shell once removed the pane’s own entry, #6931), nothing wrote it back until the next spawn, so a working agent answered “not found”.

Every LOOK_EVERY this looks at the agents that have a pane and registers each one that is missing, the way a start does (jekt_start::make_addressable). It only adds, and only for an agent whose controller holds a live process and carries that agent’s own uid, so a stopped, parked or look-alike pane is never registered. An agent registered twice is the same registration.

The process’s own exit removes only the entry it wrote (compare-and-remove on its spawn nonce), so each entry made here carries a nonce of its own, kept in Reconciled, and the next look removes it once the process has ended. A respawn that registered meanwhile has another nonce and is left alone.

Constants§

LOOK_EVERY 🔒
How often the registry is checked against the panes.

Functions§

drop_ended 🔒
Removes the entries made here whose process has ended. Returns the blocks it cleared.
next_nonce 🔒
A nonce for an entry made here. Counted down from the top, so it never meets a controller’s, which count up from 1.
process_running 🔒
Whether the block’s controller holds a live process.
reconcile 🔒
Registers every agent with a live process that the registry does not hold, and clears the entries made here for a process that has ended. Returns the uids it put back. Blocking: reads the store.
should_register 🔒
Whether an agent that is missing from the registry should be put back: its controller holds a live process and was spawned as this uid, and its block is not parked (a parked block is on its way out).
spawn 🔒
Runs reconcile on an interval for the life of the server.

Type Aliases§

Reconciled 🔒
The entries this module made: block id to the nonce it registered under.