Expand description
Slug-based lookup into the global named-agent registry.
One implementation, deliberately. This matching is subtle — the caller
holds a routing slug (AGENTMUX_AGENT_ID, e.g. "agenty") while a record
stores the display-cased instance_name (e.g. "AgentY"), so both sides
have to be normalized through derive_slug rather than compared
directly. Raw string equality here was a real bug (reagentx, PR #2428).
It lived in server::native_memory_handlers and was then re-implemented in
backend::history; reagentx P2 on PR #3480 flagged the copy, citing this
codebase’s own history of exactly that drift — “a future collision/matching
fix applied to one copy will silently miss the other.”
It lives in backend/ rather than registry/ on purpose: registry/ has
no dependency on crate::backend at all today, and derive_slug is a
backend::storage function — homing this there would have added a
registry→backend edge to a module that is currently self-contained.
Functions§
- active_
records_ 🔒matching_ slug - Every active registry record whose
instance_namenormalizes to the same slug asagent_id. Usually zero or one; more than one means a collision. - find_
active_ 🔒record_ by_ slug - The active registry record whose
instance_namenormalizes to the same slug asagent_id— only if exactly one does. - find_
active_ 🔒record_ by_ slug_ and_ definition - The active registry record matching both
agent_id’s slug and an exactdefinition_id. - working_
dir_ 🔒from_ record - Reconstruct an agent’s absolute working directory from its registry record.