fn registry_record(agent_id: &str) -> Option<NamedAgentRecord>Expand description
The global named-agent registry record for agent_id, for agents that have
no db_agents row — launching an agent does not create one, so a live agent
commonly exists only here.
Fetched at most once per sessions_for_agent call and used for BOTH
fallbacks the record can answer (definition id and working directory).
It used to return just the working directory, which meant the record’s
definition_id — sitting right there — went unread, and identity-link
resolution fell back to the raw slug instead (reagentx P1 on PR #3480,
re-review).
The lookup itself comes from backend::agent_registry_lookup, which owns
the only copy of the slug-matching and path-reconstruction rules; this
function previously re-implemented both inline, which reagentx P2 on the
same PR flagged against native_memory_handlers’ copy, since a later fix
to either one would silently miss the other.