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

Function resolve_agent_author

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

Resolve the agent author for a turn change. Looks up the user's default identity and derives an agent author with a `+tag` email. Falls back to a plain agent name if no user identity is configured. # Format With user identity `Alice ` and agent `claude-code` with session `60f5cbd2-...`: ```text Author { name: "claude+60f5", email: Some("alice@example.com") } ``` The `+tag`

(options: &AgentAuthorOptions<'_>)

Source from the content-addressed store, hash-verified

119/// Author { name: "Claude Code", email: None }
120/// ```
121pub fn resolve_agent_author(options: &AgentAuthorOptions<'_>) -> Author {
122 // A delegated identity is the only path where the key in the change
123 // header actually belongs to the agent, so it is tried first.
124 if let Some(author) = delegated_agent_author(options) {
125 return author;
126 }
127
128 // Otherwise: plus-tag the human's identity. Legible, not provable.
129 match load_default_user_identity(options.identity_dir.as_deref()) {
130 Some(user) => derive_agent_author(&user, options),
131 None => fallback_agent_author(options),
132 }
133}
134
135/// The delegation certificate currently authorizing this agent, as a URN.
136///

Calls 4

delegated_agent_authorFunction · 0.85
derive_agent_authorFunction · 0.85
fallback_agent_authorFunction · 0.85