# `Codex.Events.TurnCompaction`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/events.ex#L671)

Signals that Codex compacted a turn's history.

# `stage`

```elixir
@type stage() :: :started | :completed | :failed | :unknown | String.t()
```

# `t`

```elixir
@type t() :: %Codex.Events.TurnCompaction{
  compaction: map(),
  stage: stage(),
  thread_id: String.t() | nil,
  turn_id: String.t() | nil
}
```

---

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