MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / delegated_agent_author

Function delegated_agent_author

atomic-agent/src/identity.rs:272–290  ·  view source on GitHub ↗

Build an author from a delegated agent identity, if one is configured and resolvable. Returns `None` — rather than failing — whenever the identity is missing or unreadable. Recording a turn must not break because an agent identity was mistyped; falling back to the plus-tag author keeps the work attributed to someone* and leaves a debug log explaining why it is not keyed.

(options: &AgentAuthorOptions<'_>)

Source from the content-addressed store, hash-verified

270/// mistyped; falling back to the plus-tag author keeps the work attributed to
271/// *someone* and leaves a debug log explaining why it is not keyed.
272fn delegated_agent_author(options: &AgentAuthorOptions<'_>) -> Option<Author> {
273 let (_, identity) = load_selected_agent_identity(
274 options.agent_identity.as_deref(),
275 options.identity_dir.as_deref(),
276 )?;
277
278 let session_short = extract_session_short(options.session_id);
279 let tag = format!(
280 "{}+{}",
281 normalize_agent_name(options.agent_name),
282 session_short
283 );
284
285 Some(Author::with_identity(
286 &tag,
287 identity.email.clone(),
288 identity.public_key_base32(),
289 ))
290}
291
292/// Derive the agent author from the user's identity.
293///

Callers 1

resolve_agent_authorFunction · 0.85

Calls 4

extract_session_shortFunction · 0.85
public_key_base32Method · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected