# `ExMCP.ACP.Adapters.Codex.Sessions`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.4.0/lib/ex_mcp/acp/adapters/codex/sessions.ex#L1)

Pure session and thread helpers for the Codex ACP adapter.

# `session`

```elixir
@type session() :: map()
```

# `session_state`

```elixir
@type session_state() :: %{
  :sessions =&gt; map(),
  :model =&gt; any(),
  :mode_id =&gt; any(),
  :reasoning_effort =&gt; any(),
  optional(any()) =&gt; any()
}
```

# `store_state`

```elixir
@type store_state() :: %{:sessions =&gt; map(), optional(any()) =&gt; any()}
```

# `current_id`

```elixir
@spec current_id(store_state()) :: String.t() | nil
```

# `empty`

```elixir
@spec empty(String.t() | nil, session_state()) :: session()
```

# `fetch`

```elixir
@spec fetch(store_state(), String.t()) :: {:ok, session()} | {:error, String.t()}
```

# `fetch_id`

```elixir
@spec fetch_id(map()) :: {:ok, String.t()} | {:error, String.t()}
```

# `from_result`

```elixir
@spec from_result(String.t(), map(), session_state(), (session() -&gt; any())) ::
  session()
```

# `id_from_params`

```elixir
@spec id_from_params(map(), store_state()) :: String.t() | nil
```

# `put`

```elixir
@spec put(state, String.t() | nil, session()) :: state when state: store_state()
```

# `thread_id`

```elixir
@spec thread_id(map(), map()) :: String.t()
```

# `update`

```elixir
@spec update(state, String.t() | nil, (session() -&gt; session())) :: state
when state: session_state()
```

---

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