# `MingaAgent.Subagent.Handle`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_agent/subagent/handle.ex#L1)

Stable runtime handle for a background sub-agent session.

The handle is owned by `MingaAgent.SessionManager` and projected by editor shells for status and navigation. The public, stable identifier is `session_id`; `pid` is kept for in-process routing only.

# `t`

```elixir
@type t() :: %MingaAgent.Subagent.Handle{
  model: String.t() | nil,
  parent_pid: pid() | nil,
  parent_session_id: String.t() | nil,
  pid: pid(),
  session_id: String.t(),
  started_at: DateTime.t(),
  task: String.t()
}
```

# `id`

```elixir
@spec id(t()) :: String.t()
```

Returns the stable public handle string.

# `label`

```elixir
@spec label(t()) :: String.t()
```

Returns a short display label for UI surfaces.

# `new`

```elixir
@spec new(keyword()) :: t()
```

Creates a background sub-agent handle.

# `with_parent_pid`

```elixir
@spec with_parent_pid(t(), pid() | nil) :: t()
```

Returns a copy of the handle with a different parent pid.

# `with_pid`

```elixir
@spec with_pid(t(), pid()) :: t()
```

Returns a copy of the handle with a different pid.

---

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