# codex · Context recovery

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

- Runtime: [codex](https://ai-agents-review.com/runtime/codex.md)
- Column: [Context recovery](https://ai-agents-review.com/column/context-recovery.md) (Evidence and memory)
- Mark: 2→3 [opt: memories feature] s
- Default deployment: 2
- Best supported configuration: 3 (opt: memories feature)
- Page: https://ai-agents-review.com/cell/codex/context-recovery

## Rationale

Rollout stored, default reachable only by file re-read; memories tools list/read/search when enabled

## Rubric criteria for this column

- 0: Evidence that leaves the prompt is gone, or never stored
- 1: Only an in-prompt summary; originals not stored, or stored but unreachable by the agent
- 2: Originals stored, reachable only through generic means (re-reading files, temp-file paths named in the summary) or through a retrieval tool that is off by default
- 3: Default-on retrieval tool or command over stored transcript/memory (search plus read)
- 4: Level 3, plus automatic relevance-based injection of stored evidence **or** stable references (ids/paths) that survive restart and compaction

## Review finding

Built in. Auto-compaction is remote (OpenAI backend) or local: a summary plus up to 20k tokens of user messages. The full rollout stays outside the prompt, but by default the model has no tool to search it, only file re-reading. [opt: memory tools; gated `history`/`notes`] [E5][E6][E7][E8].

## Evidence cited by the mark

- [E6] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/core/src/compact.rs#L68-L69 — `COMPACT_USER_MESSAGE_MAX_TOKENS = 20_000` retained beside the summary — [S]
- [E8] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/ext/memories/src/tools/mod.rs#L23-L26 — memory tools list/read/search/ad_hoc_note — [S]
- [E9] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/features/src/lib.rs#L1579-L1583 — feature key `memories`, Stable, `default_enabled: false` — [S]

## Evidence also cited by the review finding

- [E5] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/core/src/session/turn.rs#L1917-L1985 — auto-compaction chooses remote (V2) or local summarization — [S]
- [E7] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/ext/history-notes/src/extension.rs#L47-L60 — `history`/`notes` backend installed only with flag + OpenAI provider + Codex-backend auth — [S]

## Grading record

- Grader A (default / best): 2 / 3
- Grader B (default / best): 2 / 3
