# `Codex.Protocol.SubAgentSource`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.16.1/lib/codex/protocol/sub_agent_source.ex#L1)

Typed representation of sub-agent session source metadata.

# `t`

```elixir
@type t() :: %Codex.Protocol.SubAgentSource{
  agent_nickname: (String.t() | nil) | nil,
  agent_role: (String.t() | nil) | nil,
  depth: (integer() | nil) | nil,
  other: (String.t() | nil) | nil,
  parent_thread_id: (String.t() | nil) | nil,
  variant: variant()
}
```

# `variant`

```elixir
@type variant() :: :review | :compact | :memory_consolidation | :thread_spawn | :other
```

# `from_map`

```elixir
@spec from_map(map() | atom() | String.t() | t() | nil) :: t()
```

# `to_map`

```elixir
@spec to_map(t()) :: map() | String.t()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
