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<'_>)
| 99 | /// Author { name: "Claude Code", email: None } |
| 100 | /// ``` |
| 101 | pub fn resolve_agent_author(options: &AgentAuthorOptions<'_>) -> Author { |
| 102 | // Try to load the user's default identity |
| 103 | match load_default_user_identity(options.identity_dir.as_deref()) { |
| 104 | Some(user) => derive_agent_author(&user, options), |
| 105 | None => fallback_agent_author(options), |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | /// Derive the agent author from the user's identity. |
| 110 | /// |